{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Starting Portfolio Value: 100000.00\n",
      "2017-01-03, Cash 100000.0 Value 100000.0\n",
      "2017-01-04, Cash 100000.0 Value 100000.0\n",
      "2017-01-05, Cash 100000.0 Value 100000.0\n",
      "2017-01-06, Cash 100000.0 Value 100000.0\n",
      "2017-01-09, Cash 100000.0 Value 100000.0\n",
      "2017-01-10, Cash 100000.0 Value 100000.0\n",
      "2017-01-11, Cash 100000.0 Value 100000.0\n",
      "2017-01-12, Cash 100000.0 Value 100000.0\n",
      "2017-01-13, Cash 100000.0 Value 100000.0\n",
      "2017-01-16, Cash 100000.0 Value 100000.0\n",
      "2017-01-17, Cash 100000.0 Value 100000.0\n",
      "2017-01-18, Cash 100000.0 Value 100000.0\n",
      "2017-01-19, Cash 100000.0 Value 100000.0\n",
      "2017-01-20, Cash 100000.0 Value 100000.0\n",
      "2017-01-23, Cash 100000.0 Value 100000.0\n",
      "2017-01-24, Cash 100000.0 Value 100000.0\n",
      "2017-01-25, Cash 100000.0 Value 100000.0\n",
      "2017-01-26, Cash 100000.0 Value 100000.0\n",
      "2017-01-27, Cash 100000.0 Value 100000.0\n",
      "2017-01-30, Cash 100000.0 Value 100000.0\n",
      "2017-01-31, Cash 100000.0 Value 100000.0\n",
      "2017-02-01, Cash 100000.0 Value 100000.0\n",
      "2017-02-02, Cash 100000.0 Value 100000.0\n",
      "2017-02-03, Cash 100000.0 Value 100000.0\n",
      "2017-02-06, Cash 100000.0 Value 100000.0\n",
      "2017-02-07, Cash 100000.0 Value 100000.0\n",
      "2017-02-08, Cash 100000.0 Value 100000.0\n",
      "2017-02-09, Cash 100000.0 Value 100000.0\n",
      "2017-02-10, Cash 100000.0 Value 100000.0\n",
      "2017-02-13, Cash 100000.0 Value 100000.0\n",
      "2017-02-13, Close, 207.00\n",
      "Max price: 219.6\n",
      "Min price: 200.0\n",
      "2017-02-14, Cash 100000.0 Value 100000.0\n",
      "2017-02-14, Close, 206.00\n",
      "Max price: 219.6\n",
      "Min price: 203.0\n",
      "2017-02-15, Cash 100000.0 Value 100000.0\n",
      "2017-02-15, Close, 201.40\n",
      "Max price: 219.6\n",
      "Min price: 201.4\n",
      "2017-02-16, Cash 100000.0 Value 100000.0\n",
      "2017-02-16, Close, 206.00\n",
      "Max price: 219.6\n",
      "Min price: 201.4\n",
      "2017-02-17, Cash 100000.0 Value 100000.0\n",
      "2017-02-17, Close, 205.00\n",
      "Max price: 219.6\n",
      "Min price: 201.4\n",
      "2017-02-20, Cash 100000.0 Value 100000.0\n",
      "2017-02-20, Close, 205.00\n",
      "Max price: 219.6\n",
      "Min price: 201.4\n",
      "2017-02-21, Cash 100000.0 Value 100000.0\n",
      "2017-02-21, Close, 206.00\n",
      "Max price: 219.6\n",
      "Min price: 201.4\n",
      "2017-02-22, Cash 100000.0 Value 100000.0\n",
      "2017-02-22, Close, 201.80\n",
      "Max price: 214.0\n",
      "Min price: 201.4\n",
      "2017-02-23, Cash 100000.0 Value 100000.0\n",
      "2017-02-23, Close, 203.00\n",
      "Max price: 212.0\n",
      "Min price: 201.4\n",
      "2017-02-24, Cash 100000.0 Value 100000.0\n",
      "2017-02-24, Close, 201.80\n",
      "Max price: 209.0\n",
      "Min price: 201.4\n",
      "2017-02-27, Cash 100000.0 Value 100000.0\n",
      "2017-02-27, Close, 203.00\n",
      "Max price: 209.0\n",
      "Min price: 201.4\n",
      "2017-02-28, Cash 100000.0 Value 100000.0\n",
      "2017-02-28, Close, 201.80\n",
      "Max price: 209.0\n",
      "Min price: 201.4\n",
      "2017-03-01, Cash 100000.0 Value 100000.0\n",
      "2017-03-01, Close, 202.80\n",
      "Max price: 209.0\n",
      "Min price: 201.4\n",
      "2017-03-02, Cash 100000.0 Value 100000.0\n",
      "2017-03-02, Close, 203.40\n",
      "Max price: 209.0\n",
      "Min price: 201.4\n",
      "2017-03-03, Cash 100000.0 Value 100000.0\n",
      "2017-03-03, Close, 201.00\n",
      "Max price: 209.0\n",
      "Min price: 201.0\n",
      "2017-03-06, Cash 100000.0 Value 100000.0\n",
      "2017-03-06, Close, 198.00\n",
      "Max price: 209.0\n",
      "Min price: 198.0\n",
      "2017-03-07, Cash 100000.0 Value 100000.0\n",
      "2017-03-07, Close, 194.90\n",
      "Max price: 209.0\n",
      "Min price: 194.9\n",
      "2017-03-08, Cash 100000.0 Value 100000.0\n",
      "2017-03-08, Close, 193.80\n",
      "Max price: 209.0\n",
      "Min price: 193.8\n",
      "2017-03-09, Cash 100000.0 Value 100000.0\n",
      "2017-03-09, Close, 197.10\n",
      "Max price: 209.0\n",
      "Min price: 193.8\n",
      "2017-03-10, Cash 100000.0 Value 100000.0\n",
      "2017-03-10, Close, 194.00\n",
      "Max price: 209.0\n",
      "Min price: 193.8\n",
      "2017-03-13, Cash 100000.0 Value 100000.0\n",
      "2017-03-13, Close, 196.80\n",
      "Max price: 208.0\n",
      "Min price: 193.8\n",
      "2017-03-14, Cash 100000.0 Value 100000.0\n",
      "2017-03-14, Close, 197.00\n",
      "Max price: 208.0\n",
      "Min price: 193.8\n",
      "2017-03-15, Cash 100000.0 Value 100000.0\n",
      "2017-03-15, Close, 196.00\n",
      "Max price: 208.0\n",
      "Min price: 193.8\n",
      "2017-03-16, Cash 100000.0 Value 100000.0\n",
      "2017-03-16, Close, 196.00\n",
      "Max price: 208.0\n",
      "Min price: 193.8\n",
      "2017-03-17, Cash 100000.0 Value 100000.0\n",
      "2017-03-17, Close, 193.20\n",
      "Max price: 208.0\n",
      "Min price: 193.2\n",
      "2017-03-20, Cash 100000.0 Value 100000.0\n",
      "2017-03-20, Close, 192.80\n",
      "Max price: 207.0\n",
      "Min price: 192.8\n",
      "2017-03-21, Cash 100000.0 Value 100000.0\n",
      "2017-03-21, Close, 194.00\n",
      "Max price: 207.0\n",
      "Min price: 192.8\n",
      "2017-03-22, Cash 100000.0 Value 100000.0\n",
      "2017-03-22, Close, 191.00\n",
      "Max price: 207.0\n",
      "Min price: 191.0\n",
      "2017-03-23, Cash 100000.0 Value 100000.0\n",
      "2017-03-23, Close, 190.20\n",
      "Max price: 207.0\n",
      "Min price: 190.2\n",
      "2017-03-24, Cash 100000.0 Value 100000.0\n",
      "2017-03-24, Close, 188.00\n",
      "Max price: 207.0\n",
      "Min price: 188.0\n",
      "2017-03-27, Cash 100000.0 Value 100000.0\n",
      "2017-03-27, Close, 182.10\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-03-28, Cash 100000.0 Value 100000.0\n",
      "2017-03-28, Close, 182.50\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-03-29, Cash 100000.0 Value 100000.0\n",
      "2017-03-29, Close, 188.00\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-03-30, Cash 100000.0 Value 100000.0\n",
      "2017-03-30, Close, 194.50\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-03-31, Cash 100000.0 Value 100000.0\n",
      "2017-03-31, Close, 197.50\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-04-03, Cash 100000.0 Value 100000.0\n",
      "2017-04-03, Close, 197.00\n",
      "Max price: 206.0\n",
      "Min price: 182.1\n",
      "2017-04-04, Cash 100000.0 Value 100000.0\n",
      "2017-04-04, Close, 198.00\n",
      "Max price: 203.4\n",
      "Min price: 182.1\n",
      "2017-04-05, Cash 100000.0 Value 100000.0\n",
      "2017-04-05, Close, 198.20\n",
      "Max price: 203.4\n",
      "Min price: 182.1\n",
      "2017-04-06, Cash 100000.0 Value 100000.0\n",
      "2017-04-06, Close, 200.00\n",
      "Max price: 203.4\n",
      "Min price: 182.1\n",
      "2017-04-07, Cash 100000.0 Value 100000.0\n",
      "2017-04-07, Close, 210.40\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-07, BUY CREATE, 210.40\n",
      "2017-04-10, BUY EXECUTED, Price: 210.00, Cost: 9870.00, Comm 59.22\n",
      "2017-04-10, Cash 90070.78 Value 99874.98\n",
      "2017-04-10, Close, 208.60\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-11, Cash 90070.78 Value 99827.98\n",
      "2017-04-11, Close, 207.60\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-12, Cash 90070.78 Value 99884.38\n",
      "2017-04-12, Close, 208.80\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-17, Cash 90070.78 Value 99893.78\n",
      "2017-04-17, Close, 209.00\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-18, Cash 90070.78 Value 99799.78\n",
      "2017-04-18, Close, 207.00\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-19, Cash 90070.78 Value 99630.58\n",
      "2017-04-19, Close, 203.40\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-20, Cash 90070.78 Value 99705.78\n",
      "2017-04-20, Close, 205.00\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-21, Cash 90070.78 Value 99846.78\n",
      "2017-04-21, Close, 208.00\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-24, Cash 90070.78 Value 99959.58\n",
      "2017-04-24, Close, 210.40\n",
      "Max price: 210.4\n",
      "Min price: 182.1\n",
      "2017-04-24, BUY CREATE, 210.40\n",
      "2017-04-25, BUY EXECUTED, Price: 210.60, Cost: 9898.20, Comm 59.39\n",
      "2017-04-25, Cash 80113.1908 Value 100229.1908\n",
      "2017-04-25, Close, 214.00\n",
      "Max price: 214.0\n",
      "Min price: 182.1\n",
      "2017-04-25, BUY CREATE, 214.00\n",
      "2017-04-26, BUY EXECUTED, Price: 214.00, Cost: 9844.00, Comm 59.06\n",
      "2017-04-26, Cash 70210.1268 Value 100170.1268\n",
      "2017-04-26, Close, 214.00\n",
      "Max price: 214.0\n",
      "Min price: 182.1\n",
      "2017-04-26, BUY CREATE, 214.00\n",
      "2017-04-27, BUY EXECUTED, Price: 214.00, Cost: 9844.00, Comm 59.06\n",
      "2017-04-27, Cash 60307.0628 Value 99367.0628\n",
      "2017-04-27, Close, 210.00\n",
      "Max price: 214.0\n",
      "Min price: 182.1\n",
      "2017-05-02, Cash 60307.0628 Value 100445.8628\n",
      "2017-05-02, Close, 215.80\n",
      "Max price: 215.8\n",
      "Min price: 182.1\n",
      "2017-05-02, BUY CREATE, 215.80\n",
      "2017-05-03, BUY EXECUTED, Price: 215.80, Cost: 9926.80, Comm 59.56\n",
      "2017-05-03, Cash 50320.702 Value 99783.10199999998\n",
      "2017-05-03, Close, 213.20\n",
      "Max price: 215.8\n",
      "Min price: 182.1\n",
      "2017-05-04, Cash 50320.702 Value 99829.50200000001\n",
      "2017-05-04, Close, 213.40\n",
      "Max price: 215.8\n",
      "Min price: 182.1\n",
      "2017-05-05, Cash 50320.702 Value 100432.70199999999\n",
      "2017-05-05, Close, 216.00\n",
      "Max price: 216.0\n",
      "Min price: 182.1\n",
      "2017-05-05, BUY CREATE, 216.00\n",
      "2017-05-08, BUY EXECUTED, Price: 216.00, Cost: 9936.00, Comm 59.62\n",
      "2017-05-08, Cash 40325.085999999996 Value 101095.886\n",
      "2017-05-08, Close, 218.60\n",
      "Max price: 218.6\n",
      "Min price: 182.1\n",
      "2017-05-08, BUY CREATE, 218.60\n",
      "2017-05-09, BUY EXECUTED, Price: 218.80, Cost: 9846.00, Comm 59.08\n",
      "2017-05-09, Cash 30420.009999999995 Value 101157.01\n",
      "2017-05-09, Close, 219.00\n",
      "Max price: 219.0\n",
      "Min price: 182.1\n",
      "2017-05-09, BUY CREATE, 219.00\n",
      "2017-05-10, BUY EXECUTED, Price: 219.00, Cost: 9855.00, Comm 59.13\n",
      "2017-05-10, Cash 20505.879999999994 Value 98153.87999999999\n",
      "2017-05-10, Close, 211.00\n",
      "Max price: 219.0\n",
      "Min price: 182.1\n",
      "2017-05-11, Cash 20505.879999999994 Value 98889.87999999999\n",
      "2017-05-11, Close, 213.00\n",
      "Max price: 219.0\n",
      "Min price: 182.1\n",
      "2017-05-12, Cash 20505.879999999994 Value 98521.87999999999\n",
      "2017-05-12, Close, 212.00\n",
      "Max price: 219.0\n",
      "Min price: 182.5\n",
      "2017-05-15, Cash 20505.879999999994 Value 96313.87999999999\n",
      "2017-05-15, Close, 206.00\n",
      "Max price: 219.0\n",
      "Min price: 188.0\n",
      "2017-05-16, Cash 20505.879999999994 Value 95945.87999999999\n",
      "2017-05-16, Close, 205.00\n",
      "Max price: 219.0\n",
      "Min price: 194.5\n",
      "2017-05-17, Cash 20505.879999999994 Value 95945.87999999999\n",
      "2017-05-17, Close, 205.00\n",
      "Max price: 219.0\n",
      "Min price: 197.0\n",
      "2017-05-18, Cash 20505.879999999994 Value 94105.87999999999\n",
      "2017-05-18, Close, 200.00\n",
      "Max price: 219.0\n",
      "Min price: 197.0\n",
      "2017-05-19, Cash 20505.879999999994 Value 95209.87999999999\n",
      "2017-05-19, Close, 203.00\n",
      "Max price: 219.0\n",
      "Min price: 198.0\n",
      "2017-05-22, Cash 20505.879999999994 Value 94915.47999999998\n",
      "2017-05-22, Close, 202.20\n",
      "Max price: 219.0\n",
      "Min price: 198.2\n",
      "2017-05-23, Cash 20505.879999999994 Value 94473.87999999999\n",
      "2017-05-23, Close, 201.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-24, Cash 20505.879999999994 Value 96387.47999999998\n",
      "2017-05-24, Close, 206.20\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-25, Cash 20505.879999999994 Value 96681.87999999999\n",
      "2017-05-25, Close, 207.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-26, Cash 20505.879999999994 Value 94621.07999999999\n",
      "2017-05-26, Close, 201.40\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-29, Cash 20505.879999999994 Value 95209.87999999999\n",
      "2017-05-29, Close, 203.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-30, Cash 20505.879999999994 Value 95504.28\n",
      "2017-05-30, Close, 203.80\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-05-31, Cash 20505.879999999994 Value 95798.68\n",
      "2017-05-31, Close, 204.60\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-01, Cash 20505.879999999994 Value 99993.87999999999\n",
      "2017-06-01, Close, 216.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-02, Cash 20505.879999999994 Value 99257.87999999999\n",
      "2017-06-02, Close, 214.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-05, Cash 20505.879999999994 Value 99993.87999999999\n",
      "2017-06-05, Close, 216.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-06, Cash 20505.879999999994 Value 99552.28\n",
      "2017-06-06, Close, 214.80\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-07, Cash 20505.879999999994 Value 100214.68\n",
      "2017-06-07, Close, 216.60\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-08, Cash 20505.879999999994 Value 99920.28\n",
      "2017-06-08, Close, 215.80\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-09, Cash 20505.879999999994 Value 99920.28\n",
      "2017-06-09, Close, 215.80\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-13, Cash 20505.879999999994 Value 99331.47999999998\n",
      "2017-06-13, Close, 214.20\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-14, Cash 20505.879999999994 Value 99773.07999999999\n",
      "2017-06-14, Close, 215.40\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-15, Cash 20505.879999999994 Value 99699.47999999998\n",
      "2017-06-15, Close, 215.20\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-16, Cash 20505.879999999994 Value 100361.87999999999\n",
      "2017-06-16, Close, 217.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-19, Cash 20505.879999999994 Value 99993.87999999999\n",
      "2017-06-19, Close, 216.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-20, Cash 20505.879999999994 Value 99625.87999999999\n",
      "2017-06-20, Close, 215.00\n",
      "Max price: 219.0\n",
      "Min price: 200.0\n",
      "2017-06-21, Cash 20505.879999999994 Value 99773.07999999999\n",
      "2017-06-21, Close, 215.40\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-22, Cash 20505.879999999994 Value 98816.28\n",
      "2017-06-22, Close, 212.80\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-23, Cash 20505.879999999994 Value 98153.87999999999\n",
      "2017-06-23, Close, 211.00\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-27, Cash 20505.879999999994 Value 97785.87999999999\n",
      "2017-06-27, Close, 210.00\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-28, Cash 20505.879999999994 Value 97270.68\n",
      "2017-06-28, Close, 208.60\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-29, Cash 20505.879999999994 Value 96093.07999999999\n",
      "2017-06-29, Close, 205.40\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-06-30, Cash 20505.879999999994 Value 95577.87999999999\n",
      "2017-06-30, Close, 204.00\n",
      "Max price: 217.0\n",
      "Min price: 200.0\n",
      "2017-07-03, Cash 20505.879999999994 Value 96387.47999999998\n",
      "2017-07-03, Close, 206.20\n",
      "Max price: 217.0\n",
      "Min price: 201.0\n",
      "2017-07-04, Cash 20505.879999999994 Value 97049.87999999999\n",
      "2017-07-04, Close, 208.00\n",
      "Max price: 217.0\n",
      "Min price: 201.0\n",
      "2017-07-05, Cash 20505.879999999994 Value 97049.87999999999\n",
      "2017-07-05, Close, 208.00\n",
      "Max price: 217.0\n",
      "Min price: 201.0\n",
      "2017-07-06, Cash 20505.879999999994 Value 96755.47999999998\n",
      "2017-07-06, Close, 207.20\n",
      "Max price: 217.0\n",
      "Min price: 201.4\n",
      "2017-07-07, Cash 20505.879999999994 Value 97049.87999999999\n",
      "2017-07-07, Close, 208.00\n",
      "Max price: 217.0\n",
      "Min price: 201.4\n",
      "2017-07-10, Cash 20505.879999999994 Value 97049.87999999999\n",
      "2017-07-10, Close, 208.00\n",
      "Max price: 217.0\n",
      "Min price: 201.4\n",
      "2017-07-11, Cash 20505.879999999994 Value 97049.87999999999\n",
      "2017-07-11, Close, 208.00\n",
      "Max price: 217.0\n",
      "Min price: 203.0\n",
      "2017-07-12, Cash 20505.879999999994 Value 98521.87999999999\n",
      "2017-07-12, Close, 212.00\n",
      "Max price: 217.0\n",
      "Min price: 203.8\n",
      "2017-07-13, Cash 20505.879999999994 Value 99478.68\n",
      "2017-07-13, Close, 214.60\n",
      "Max price: 217.0\n",
      "Min price: 204.0\n",
      "2017-07-14, Cash 20505.879999999994 Value 99625.87999999999\n",
      "2017-07-14, Close, 215.00\n",
      "Max price: 217.0\n",
      "Min price: 204.0\n",
      "2017-07-17, Cash 20505.879999999994 Value 99699.47999999998\n",
      "2017-07-17, Close, 215.20\n",
      "Max price: 217.0\n",
      "Min price: 204.0\n",
      "2017-07-18, Cash 20505.879999999994 Value 100361.87999999999\n",
      "2017-07-18, Close, 217.00\n",
      "Max price: 217.0\n",
      "Min price: 204.0\n",
      "2017-07-18, BUY CREATE, 217.00\n",
      "2017-07-19, BUY EXECUTED, Price: 217.00, Cost: 9982.00, Comm 59.89\n",
      "2017-07-19, Cash 10463.987999999994 Value 101709.588\n",
      "2017-07-19, Close, 220.40\n",
      "Max price: 220.4\n",
      "Min price: 204.0\n",
      "2017-07-19, BUY CREATE, 220.40\n",
      "2017-07-20, BUY EXECUTED, Price: 220.40, Cost: 9918.00, Comm 59.51\n",
      "2017-07-20, Cash 486.47999999999394 Value 101466.48\n",
      "2017-07-20, Close, 220.00\n",
      "Max price: 220.4\n",
      "Min price: 204.0\n",
      "2017-07-21, Cash 486.47999999999394 Value 102292.68000000001\n",
      "2017-07-21, Close, 221.80\n",
      "Max price: 221.8\n",
      "Min price: 204.0\n",
      "2017-07-21, BUY CREATE, 221.80\n",
      "2017-07-24, BUY EXECUTED, Price: 221.80, Cost: 443.60, Comm 2.66\n",
      "2017-07-24, Cash 40.21839999999391 Value 101091.4184\n",
      "2017-07-24, Close, 219.20\n",
      "Max price: 221.8\n",
      "Min price: 204.0\n",
      "2017-07-25, Cash 40.21839999999391 Value 100446.0184\n",
      "2017-07-25, Close, 217.80\n",
      "Max price: 221.8\n",
      "Min price: 204.0\n",
      "2017-07-26, Cash 40.21839999999391 Value 99985.0184\n",
      "2017-07-26, Close, 216.80\n",
      "Max price: 221.8\n",
      "Min price: 204.0\n",
      "2017-07-27, Cash 40.21839999999391 Value 100999.2184\n",
      "2017-07-27, Close, 219.00\n",
      "Max price: 221.8\n",
      "Min price: 204.0\n",
      "2017-07-28, Cash 40.21839999999391 Value 102382.2184\n",
      "2017-07-28, Close, 222.00\n",
      "Max price: 222.0\n",
      "Min price: 204.0\n",
      "2017-07-31, Cash 40.21839999999391 Value 103765.2184\n",
      "2017-07-31, Close, 225.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-01, Cash 40.21839999999391 Value 102843.2184\n",
      "2017-08-01, Close, 223.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-02, Cash 40.21839999999391 Value 100538.2184\n",
      "2017-08-02, Close, 218.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-03, Cash 40.21839999999391 Value 99616.2184\n",
      "2017-08-03, Close, 216.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-04, Cash 40.21839999999391 Value 99247.4184\n",
      "2017-08-04, Close, 215.20\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-07, Cash 40.21839999999391 Value 100999.2184\n",
      "2017-08-07, Close, 219.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-08, Cash 40.21839999999391 Value 100999.2184\n",
      "2017-08-08, Close, 219.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-09, Cash 40.21839999999391 Value 100077.2184\n",
      "2017-08-09, Close, 217.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-10, Cash 40.21839999999391 Value 100077.2184\n",
      "2017-08-10, Close, 217.00\n",
      "Max price: 225.0\n",
      "Min price: 204.0\n",
      "2017-08-11, Cash 40.21839999999391 Value 99800.6184\n",
      "2017-08-11, Close, 216.40\n",
      "Max price: 225.0\n",
      "Min price: 206.2\n",
      "2017-08-14, Cash 40.21839999999391 Value 102382.2184\n",
      "2017-08-14, Close, 222.00\n",
      "Max price: 225.0\n",
      "Min price: 207.2\n",
      "2017-08-15, Cash 40.21839999999391 Value 103765.2184\n",
      "2017-08-15, Close, 225.00\n",
      "Max price: 225.0\n",
      "Min price: 207.2\n",
      "2017-08-16, Cash 40.21839999999391 Value 110219.2184\n",
      "2017-08-16, Close, 239.00\n",
      "Max price: 239.0\n",
      "Min price: 207.2\n",
      "2017-08-17, Cash 40.21839999999391 Value 109850.4184\n",
      "2017-08-17, Close, 238.20\n",
      "Max price: 239.0\n",
      "Min price: 208.0\n",
      "2017-08-18, Cash 40.21839999999391 Value 108467.4184\n",
      "2017-08-18, Close, 235.20\n",
      "Max price: 239.0\n",
      "Min price: 208.0\n",
      "2017-08-22, Cash 40.21839999999391 Value 110680.2184\n",
      "2017-08-22, Close, 240.00\n",
      "Max price: 240.0\n",
      "Min price: 208.0\n",
      "2017-08-23, Cash 40.21839999999391 Value 110311.4184\n",
      "2017-08-23, Close, 239.20\n",
      "Max price: 240.0\n",
      "Min price: 212.0\n",
      "2017-08-24, Cash 40.21839999999391 Value 110680.2184\n",
      "2017-08-24, Close, 240.00\n",
      "Max price: 240.0\n",
      "Min price: 214.6\n",
      "2017-08-25, Cash 40.21839999999391 Value 110219.2184\n",
      "2017-08-25, Close, 239.00\n",
      "Max price: 240.0\n",
      "Min price: 215.0\n",
      "2017-08-29, Cash 40.21839999999391 Value 110127.0184\n",
      "2017-08-29, Close, 238.80\n",
      "Max price: 240.0\n",
      "Min price: 215.2\n",
      "2017-08-30, Cash 40.21839999999391 Value 110127.0184\n",
      "2017-08-30, Close, 238.80\n",
      "Max price: 240.0\n",
      "Min price: 215.2\n",
      "2017-08-31, Cash 40.21839999999391 Value 109850.4184\n",
      "2017-08-31, Close, 238.20\n",
      "Max price: 240.0\n",
      "Min price: 215.2\n",
      "2017-09-04, Cash 40.21839999999391 Value 109758.2184\n",
      "2017-09-04, Close, 238.00\n",
      "Max price: 240.0\n",
      "Min price: 215.2\n",
      "2017-09-05, Cash 40.21839999999391 Value 112524.2184\n",
      "2017-09-05, Close, 244.00\n",
      "Max price: 244.0\n",
      "Min price: 215.2\n",
      "2017-09-06, Cash 40.21839999999391 Value 111141.2184\n",
      "2017-09-06, Close, 241.00\n",
      "Max price: 244.0\n",
      "Min price: 215.2\n",
      "2017-09-07, Cash 40.21839999999391 Value 113261.8184\n",
      "2017-09-07, Close, 245.60\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-08, Cash 40.21839999999391 Value 112524.2184\n",
      "2017-09-08, Close, 244.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-11, Cash 40.21839999999391 Value 112524.2184\n",
      "2017-09-11, Close, 244.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-13, Cash 40.21839999999391 Value 111602.2184\n",
      "2017-09-13, Close, 242.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-14, Cash 40.21839999999391 Value 112985.2184\n",
      "2017-09-14, Close, 245.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-15, Cash 40.21839999999391 Value 112063.2184\n",
      "2017-09-15, Close, 243.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-18, Cash 40.21839999999391 Value 112985.2184\n",
      "2017-09-18, Close, 245.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-19, Cash 40.21839999999391 Value 112524.2184\n",
      "2017-09-19, Close, 244.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-20, Cash 40.21839999999391 Value 111602.2184\n",
      "2017-09-20, Close, 242.00\n",
      "Max price: 245.6\n",
      "Min price: 215.2\n",
      "2017-09-21, Cash 40.21839999999391 Value 113446.2184\n",
      "2017-09-21, Close, 246.00\n",
      "Max price: 246.0\n",
      "Min price: 216.4\n",
      "2017-09-22, Cash 40.21839999999391 Value 112893.0184\n",
      "2017-09-22, Close, 244.80\n",
      "Max price: 246.0\n",
      "Min price: 216.4\n",
      "2017-09-25, Cash 40.21839999999391 Value 112985.2184\n",
      "2017-09-25, Close, 245.00\n",
      "Max price: 246.0\n",
      "Min price: 216.4\n",
      "2017-09-26, Cash 40.21839999999391 Value 115198.0184\n",
      "2017-09-26, Close, 249.80\n",
      "Max price: 249.8\n",
      "Min price: 216.4\n",
      "2017-09-27, Cash 40.21839999999391 Value 114737.0184\n",
      "2017-09-27, Close, 248.80\n",
      "Max price: 249.8\n",
      "Min price: 216.4\n",
      "2017-09-28, Cash 40.21839999999391 Value 111602.2184\n",
      "2017-09-28, Close, 242.00\n",
      "Max price: 249.8\n",
      "Min price: 222.0\n",
      "2017-09-29, Cash 40.21839999999391 Value 112432.0184\n",
      "2017-09-29, Close, 243.80\n",
      "Max price: 249.8\n",
      "Min price: 225.0\n",
      "2017-10-02, Cash 40.21839999999391 Value 111878.8184\n",
      "2017-10-02, Close, 242.60\n",
      "Max price: 249.8\n",
      "Min price: 235.2\n",
      "2017-10-03, Cash 40.21839999999391 Value 111602.2184\n",
      "2017-10-03, Close, 242.00\n",
      "Max price: 249.8\n",
      "Min price: 235.2\n",
      "2017-10-04, Cash 40.21839999999391 Value 111786.6184\n",
      "2017-10-04, Close, 242.40\n",
      "Max price: 249.8\n",
      "Min price: 235.2\n",
      "2017-10-05, Cash 40.21839999999391 Value 111510.0184\n",
      "2017-10-05, Close, 241.80\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-06, Cash 40.21839999999391 Value 111694.4184\n",
      "2017-10-06, Close, 242.20\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-09, Cash 40.21839999999391 Value 113354.0184\n",
      "2017-10-09, Close, 245.80\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-10, Cash 40.21839999999391 Value 112985.2184\n",
      "2017-10-10, Close, 245.00\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-11, Cash 40.21839999999391 Value 112524.2184\n",
      "2017-10-11, Close, 244.00\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-12, Cash 40.21839999999391 Value 112800.8184\n",
      "2017-10-12, Close, 244.60\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-13, Cash 40.21839999999391 Value 113907.2184\n",
      "2017-10-13, Close, 247.00\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-17, Cash 40.21839999999391 Value 112985.2184\n",
      "2017-10-17, Close, 245.00\n",
      "Max price: 249.8\n",
      "Min price: 238.0\n",
      "2017-10-18, Cash 40.21839999999391 Value 113446.2184\n",
      "2017-10-18, Close, 246.00\n",
      "Max price: 249.8\n",
      "Min price: 241.0\n",
      "2017-10-19, Cash 40.21839999999391 Value 113907.2184\n",
      "2017-10-19, Close, 247.00\n",
      "Max price: 249.8\n",
      "Min price: 241.0\n",
      "2017-10-20, Cash 40.21839999999391 Value 113446.2184\n",
      "2017-10-20, Close, 246.00\n",
      "Max price: 249.8\n",
      "Min price: 241.8\n",
      "2017-10-23, Cash 40.21839999999391 Value 114829.2184\n",
      "2017-10-23, Close, 249.00\n",
      "Max price: 249.8\n",
      "Min price: 241.8\n",
      "2017-10-24, Cash 40.21839999999391 Value 114368.2184\n",
      "2017-10-24, Close, 248.00\n",
      "Max price: 249.8\n",
      "Min price: 241.8\n",
      "2017-10-25, Cash 40.21839999999391 Value 115290.2184\n",
      "2017-10-25, Close, 250.00\n",
      "Max price: 250.0\n",
      "Min price: 241.8\n",
      "2017-10-26, Cash 40.21839999999391 Value 115290.2184\n",
      "2017-10-26, Close, 250.00\n",
      "Max price: 250.0\n",
      "Min price: 241.8\n",
      "2017-10-27, Cash 40.21839999999391 Value 115198.0184\n",
      "2017-10-27, Close, 249.80\n",
      "Max price: 250.0\n",
      "Min price: 241.8\n",
      "2017-10-30, Cash 40.21839999999391 Value 114829.2184\n",
      "2017-10-30, Close, 249.00\n",
      "Max price: 250.0\n",
      "Min price: 241.8\n",
      "2017-11-02, Cash 40.21839999999391 Value 115935.6184\n",
      "2017-11-02, Close, 251.40\n",
      "Max price: 251.4\n",
      "Min price: 241.8\n",
      "2017-11-03, Cash 40.21839999999391 Value 114460.4184\n",
      "2017-11-03, Close, 248.20\n",
      "Max price: 251.4\n",
      "Min price: 241.8\n",
      "2017-11-06, Cash 40.21839999999391 Value 115751.2184\n",
      "2017-11-06, Close, 251.00\n",
      "Max price: 251.4\n",
      "Min price: 241.8\n",
      "2017-11-07, Cash 40.21839999999391 Value 116857.6184\n",
      "2017-11-07, Close, 253.40\n",
      "Max price: 253.4\n",
      "Min price: 241.8\n",
      "2017-11-08, Cash 40.21839999999391 Value 116212.2184\n",
      "2017-11-08, Close, 252.00\n",
      "Max price: 253.4\n",
      "Min price: 241.8\n",
      "2017-11-09, Cash 40.21839999999391 Value 116673.2184\n",
      "2017-11-09, Close, 253.00\n",
      "Max price: 253.4\n",
      "Min price: 241.8\n",
      "2017-11-10, Cash 40.21839999999391 Value 115843.4184\n",
      "2017-11-10, Close, 251.20\n",
      "Max price: 253.4\n",
      "Min price: 241.8\n",
      "2017-11-13, Cash 40.21839999999391 Value 118517.2184\n",
      "2017-11-13, Close, 257.00\n",
      "Max price: 257.0\n",
      "Min price: 241.8\n",
      "2017-11-14, Cash 40.21839999999391 Value 119715.8184\n",
      "2017-11-14, Close, 259.60\n",
      "Max price: 259.6\n",
      "Min price: 241.8\n",
      "2017-11-15, Cash 40.21839999999391 Value 117964.0184\n",
      "2017-11-15, Close, 255.80\n",
      "Max price: 259.6\n",
      "Min price: 241.8\n",
      "2017-11-16, Cash 40.21839999999391 Value 119347.0184\n",
      "2017-11-16, Close, 258.80\n",
      "Max price: 259.6\n",
      "Min price: 241.8\n",
      "2017-11-17, Cash 40.21839999999391 Value 119808.0184\n",
      "2017-11-17, Close, 259.80\n",
      "Max price: 259.8\n",
      "Min price: 241.8\n",
      "2017-11-20, Cash 40.21839999999391 Value 118517.2184\n",
      "2017-11-20, Close, 257.00\n",
      "Max price: 259.8\n",
      "Min price: 241.8\n",
      "2017-11-21, Cash 40.21839999999391 Value 117134.2184\n",
      "2017-11-21, Close, 254.00\n",
      "Max price: 259.8\n",
      "Min price: 242.2\n",
      "2017-11-22, Cash 40.21839999999391 Value 117595.2184\n",
      "2017-11-22, Close, 255.00\n",
      "Max price: 259.8\n",
      "Min price: 244.0\n",
      "2017-11-23, Cash 40.21839999999391 Value 117134.2184\n",
      "2017-11-23, Close, 254.00\n",
      "Max price: 259.8\n",
      "Min price: 244.0\n",
      "2017-11-24, Cash 40.21839999999391 Value 119162.61839999999\n",
      "2017-11-24, Close, 258.40\n",
      "Max price: 259.8\n",
      "Min price: 244.0\n",
      "2017-11-27, Cash 40.21839999999391 Value 117134.2184\n",
      "2017-11-27, Close, 254.00\n",
      "Max price: 259.8\n",
      "Min price: 244.6\n",
      "2017-11-28, Cash 40.21839999999391 Value 116212.2184\n",
      "2017-11-28, Close, 252.00\n",
      "Max price: 259.8\n",
      "Min price: 245.0\n",
      "2017-11-29, Cash 40.21839999999391 Value 112339.8184\n",
      "2017-11-29, Close, 243.60\n",
      "Max price: 259.8\n",
      "Min price: 243.6\n",
      "2017-11-29, SELL CREATE, 243.60\n",
      "2017-12-01, SELL EXECUTED, Price: 244.00, Cost: 4310.79, Comm 29.28\n",
      "2017-12-01, Cash 4890.9383999999945 Value 113112.33840000001\n",
      "2017-12-01, Close, 245.40\n",
      "Max price: 259.8\n",
      "Min price: 243.6\n",
      "2017-12-04, Cash 4890.9383999999945 Value 111348.33840000001\n",
      "2017-12-04, Close, 241.40\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-04, SELL CREATE, 241.40\n",
      "2017-12-05, SELL EXECUTED, Price: 241.40, Cost: 4310.79, Comm 28.97\n",
      "2017-12-05, Cash 9689.970399999995 Value 112329.7704\n",
      "2017-12-05, Close, 243.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-06, Cash 9689.970399999995 Value 111992.97039999999\n",
      "2017-12-06, Close, 243.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-07, Cash 9689.970399999995 Value 113592.7704\n",
      "2017-12-07, Close, 246.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-08, Cash 9689.970399999995 Value 114434.7704\n",
      "2017-12-08, Close, 248.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-11, Cash 9689.970399999995 Value 114518.97039999999\n",
      "2017-12-11, Close, 249.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-12, Cash 9689.970399999995 Value 114687.37040000001\n",
      "2017-12-12, Close, 249.40\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-13, Cash 9689.970399999995 Value 113676.97039999999\n",
      "2017-12-13, Close, 247.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-14, Cash 9689.970399999995 Value 112413.97039999999\n",
      "2017-12-14, Close, 244.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-15, Cash 9689.970399999995 Value 113255.97039999999\n",
      "2017-12-15, Close, 246.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-18, Cash 9689.970399999995 Value 114687.37040000001\n",
      "2017-12-18, Close, 249.40\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-19, Cash 9689.970399999995 Value 112666.57039999998\n",
      "2017-12-19, Close, 244.60\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-20, Cash 9689.970399999995 Value 112329.7704\n",
      "2017-12-20, Close, 243.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-21, Cash 9689.970399999995 Value 114013.7704\n",
      "2017-12-21, Close, 247.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-22, Cash 9689.970399999995 Value 113676.97039999999\n",
      "2017-12-22, Close, 247.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-27, Cash 9689.970399999995 Value 114434.7704\n",
      "2017-12-27, Close, 248.80\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-28, Cash 9689.970399999995 Value 116623.97039999999\n",
      "2017-12-28, Close, 254.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2017-12-29, Cash 9689.970399999995 Value 116202.97039999999\n",
      "2017-12-29, Close, 253.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2018-01-03, Cash 9689.970399999995 Value 117213.37040000001\n",
      "2018-01-03, Close, 255.40\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2018-01-04, Cash 9689.970399999995 Value 117044.97039999999\n",
      "2018-01-04, Close, 255.00\n",
      "Max price: 259.8\n",
      "Min price: 241.4\n",
      "2018-01-05, Cash 9689.970399999995 Value 117044.97039999999\n",
      "2018-01-05, Close, 255.00\n",
      "Max price: 258.4\n",
      "Min price: 241.4\n",
      "2018-01-08, Cash 9689.970399999995 Value 117465.97039999999\n",
      "2018-01-08, Close, 256.00\n",
      "Max price: 258.4\n",
      "Min price: 241.4\n",
      "2018-01-09, Cash 9689.970399999995 Value 117381.7704\n",
      "2018-01-09, Close, 255.80\n",
      "Max price: 258.4\n",
      "Min price: 241.4\n",
      "2018-01-10, Cash 9689.970399999995 Value 117213.37040000001\n",
      "2018-01-10, Close, 255.40\n",
      "Max price: 258.4\n",
      "Min price: 241.4\n",
      "2018-01-11, Cash 9689.970399999995 Value 117044.97039999999\n",
      "2018-01-11, Close, 255.00\n",
      "Max price: 258.4\n",
      "Min price: 241.4\n",
      "2018-01-12, Cash 9689.970399999995 Value 117044.97039999999\n",
      "2018-01-12, Close, 255.00\n",
      "Max price: 256.0\n",
      "Min price: 241.4\n",
      "2018-01-15, Cash 9689.970399999995 Value 120749.7704\n",
      "2018-01-15, Close, 263.80\n",
      "Max price: 263.8\n",
      "Min price: 241.4\n",
      "2018-01-15, BUY CREATE, 263.80\n",
      "2018-01-16, BUY EXECUTED, Price: 263.80, Cost: 9496.80, Comm 56.98\n",
      "2018-01-16, Cash 136.18959999999362 Value 126999.38960000001\n",
      "2018-01-16, Close, 277.60\n",
      "Max price: 277.6\n",
      "Min price: 241.4\n",
      "2018-01-17, Cash 136.18959999999362 Value 126999.38960000001\n",
      "2018-01-17, Close, 277.60\n",
      "Max price: 277.6\n",
      "Min price: 241.4\n",
      "2018-01-18, Cash 136.18959999999362 Value 127639.1896\n",
      "2018-01-18, Close, 279.00\n",
      "Max price: 279.0\n",
      "Min price: 241.4\n",
      "2018-01-19, Cash 136.18959999999362 Value 128096.1896\n",
      "2018-01-19, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-01-22, Cash 136.18959999999362 Value 129467.1896\n",
      "2018-01-22, Close, 283.00\n",
      "Max price: 283.0\n",
      "Min price: 243.0\n",
      "2018-01-23, Cash 136.18959999999362 Value 129101.58959999999\n",
      "2018-01-23, Close, 282.20\n",
      "Max price: 283.0\n",
      "Min price: 243.8\n",
      "2018-01-24, Cash 136.18959999999362 Value 129010.1896\n",
      "2018-01-24, Close, 282.00\n",
      "Max price: 283.0\n",
      "Min price: 243.8\n",
      "2018-01-25, Cash 136.18959999999362 Value 134037.18959999998\n",
      "2018-01-25, Close, 293.00\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-01-26, Cash 136.18959999999362 Value 133671.58959999998\n",
      "2018-01-26, Close, 292.20\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-01-29, Cash 136.18959999999362 Value 130563.98959999999\n",
      "2018-01-29, Close, 285.40\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-01-30, Cash 136.18959999999362 Value 130015.58959999999\n",
      "2018-01-30, Close, 284.20\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-01-31, Cash 136.18959999999362 Value 130289.7896\n",
      "2018-01-31, Close, 284.80\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-02-01, Cash 136.18959999999362 Value 131386.58959999998\n",
      "2018-02-01, Close, 287.20\n",
      "Max price: 293.0\n",
      "Min price: 243.8\n",
      "2018-02-02, Cash 136.18959999999362 Value 134494.18959999998\n",
      "2018-02-02, Close, 294.00\n",
      "Max price: 294.0\n",
      "Min price: 243.8\n",
      "2018-02-05, Cash 136.18959999999362 Value 129010.1896\n",
      "2018-02-05, Close, 282.00\n",
      "Max price: 294.0\n",
      "Min price: 243.8\n",
      "2018-02-06, Cash 136.18959999999362 Value 132209.18959999998\n",
      "2018-02-06, Close, 289.00\n",
      "Max price: 294.0\n",
      "Min price: 247.0\n",
      "2018-02-07, Cash 136.18959999999362 Value 134128.58959999998\n",
      "2018-02-07, Close, 293.20\n",
      "Max price: 294.0\n",
      "Min price: 247.0\n",
      "2018-02-08, Cash 136.18959999999362 Value 133945.7896\n",
      "2018-02-08, Close, 292.80\n",
      "Max price: 294.0\n",
      "Min price: 248.8\n",
      "2018-02-09, Cash 136.18959999999362 Value 133580.18959999998\n",
      "2018-02-09, Close, 292.00\n",
      "Max price: 294.0\n",
      "Min price: 253.0\n",
      "2018-02-12, Cash 136.18959999999362 Value 129467.1896\n",
      "2018-02-12, Close, 283.00\n",
      "Max price: 294.0\n",
      "Min price: 253.0\n",
      "2018-02-13, Cash 136.18959999999362 Value 126725.1896\n",
      "2018-02-13, Close, 277.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-14, Cash 136.18959999999362 Value 127182.1896\n",
      "2018-02-14, Close, 278.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-15, Cash 136.18959999999362 Value 130381.1896\n",
      "2018-02-15, Close, 285.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-19, Cash 136.18959999999362 Value 130381.1896\n",
      "2018-02-19, Close, 285.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-20, Cash 136.18959999999362 Value 130838.1896\n",
      "2018-02-20, Close, 286.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-21, Cash 136.18959999999362 Value 129010.1896\n",
      "2018-02-21, Close, 282.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-22, Cash 136.18959999999362 Value 129010.1896\n",
      "2018-02-22, Close, 282.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-23, Cash 136.18959999999362 Value 129010.1896\n",
      "2018-02-23, Close, 282.00\n",
      "Max price: 294.0\n",
      "Min price: 255.0\n",
      "2018-02-26, Cash 136.18959999999362 Value 133580.18959999998\n",
      "2018-02-26, Close, 292.00\n",
      "Max price: 294.0\n",
      "Min price: 263.8\n",
      "2018-02-27, Cash 136.18959999999362 Value 134951.18959999998\n",
      "2018-02-27, Close, 295.00\n",
      "Max price: 295.0\n",
      "Min price: 277.0\n",
      "2018-02-28, Cash 136.18959999999362 Value 136504.98959999997\n",
      "2018-02-28, Close, 298.40\n",
      "Max price: 298.4\n",
      "Min price: 277.0\n",
      "2018-03-01, Cash 136.18959999999362 Value 136139.3896\n",
      "2018-03-01, Close, 297.60\n",
      "Max price: 298.4\n",
      "Min price: 277.0\n",
      "2018-03-02, Cash 136.18959999999362 Value 136322.18959999998\n",
      "2018-03-02, Close, 298.00\n",
      "Max price: 298.4\n",
      "Min price: 277.0\n",
      "2018-03-05, Cash 136.18959999999362 Value 137053.3896\n",
      "2018-03-05, Close, 299.60\n",
      "Max price: 299.6\n",
      "Min price: 277.0\n",
      "2018-03-06, Cash 136.18959999999362 Value 136596.3896\n",
      "2018-03-06, Close, 298.60\n",
      "Max price: 299.6\n",
      "Min price: 277.0\n",
      "2018-03-07, Cash 136.18959999999362 Value 139064.18959999998\n",
      "2018-03-07, Close, 304.00\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-08, Cash 136.18959999999362 Value 134951.18959999998\n",
      "2018-03-08, Close, 295.00\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-09, Cash 136.18959999999362 Value 133580.18959999998\n",
      "2018-03-09, Close, 292.00\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-12, Cash 136.18959999999362 Value 135133.98959999997\n",
      "2018-03-12, Close, 295.40\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-13, Cash 136.18959999999362 Value 134037.18959999998\n",
      "2018-03-13, Close, 293.00\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-14, Cash 136.18959999999362 Value 131934.98959999997\n",
      "2018-03-14, Close, 288.40\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-15, Cash 136.18959999999362 Value 129924.1896\n",
      "2018-03-15, Close, 284.00\n",
      "Max price: 304.0\n",
      "Min price: 277.0\n",
      "2018-03-16, Cash 136.18959999999362 Value 139703.98959999997\n",
      "2018-03-16, Close, 305.40\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-19, Cash 136.18959999999362 Value 136322.18959999998\n",
      "2018-03-19, Close, 298.00\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-20, Cash 136.18959999999362 Value 130838.1896\n",
      "2018-03-20, Close, 286.00\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-21, Cash 136.18959999999362 Value 130381.1896\n",
      "2018-03-21, Close, 285.00\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-22, Cash 136.18959999999362 Value 131203.7896\n",
      "2018-03-22, Close, 286.80\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-23, Cash 136.18959999999362 Value 131752.18959999998\n",
      "2018-03-23, Close, 288.00\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-26, Cash 136.18959999999362 Value 134951.18959999998\n",
      "2018-03-26, Close, 295.00\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-27, Cash 136.18959999999362 Value 134676.98959999997\n",
      "2018-03-27, Close, 294.40\n",
      "Max price: 305.4\n",
      "Min price: 277.0\n",
      "2018-03-28, Cash 136.18959999999362 Value 136779.18959999998\n",
      "2018-03-28, Close, 299.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-02, Cash 136.18959999999362 Value 137236.18959999998\n",
      "2018-04-02, Close, 300.00\n",
      "Max price: 305.4\n",
      "Min price: 282.0\n",
      "2018-04-03, Cash 136.18959999999362 Value 135590.98959999997\n",
      "2018-04-03, Close, 296.40\n",
      "Max price: 305.4\n",
      "Min price: 282.0\n",
      "2018-04-04, Cash 136.18959999999362 Value 130381.1896\n",
      "2018-04-04, Close, 285.00\n",
      "Max price: 305.4\n",
      "Min price: 282.0\n",
      "2018-04-05, Cash 136.18959999999362 Value 128096.1896\n",
      "2018-04-05, Close, 280.00\n",
      "Max price: 305.4\n",
      "Min price: 280.0\n",
      "2018-04-05, SELL CREATE, 280.00\n",
      "2018-04-06, SELL EXECUTED, Price: 281.00, Cost: 3728.80, Comm 28.66\n",
      "2018-04-06, Cash 4884.527599999993 Value 127204.52759999999\n",
      "2018-04-06, Close, 278.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-06, SELL CREATE, 278.00\n",
      "2018-04-10, SELL EXECUTED, Price: 278.00, Cost: 3728.80, Comm 28.36\n",
      "2018-04-10, Cash 9582.171599999994 Value 129714.1716\n",
      "2018-04-10, Close, 284.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-11, Cash 9582.171599999994 Value 132082.9716\n",
      "2018-04-11, Close, 289.60\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-12, Cash 9582.171599999994 Value 136482.1716\n",
      "2018-04-12, Close, 300.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-13, Cash 9582.171599999994 Value 133182.7716\n",
      "2018-04-13, Close, 292.20\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-16, Cash 9582.171599999994 Value 132928.9716\n",
      "2018-04-16, Close, 291.60\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-17, Cash 9582.171599999994 Value 131659.9716\n",
      "2018-04-17, Close, 288.60\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-18, Cash 9582.171599999994 Value 134028.7716\n",
      "2018-04-18, Close, 294.20\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-19, Cash 9582.171599999994 Value 130137.1716\n",
      "2018-04-19, Close, 285.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-20, Cash 9582.171599999994 Value 132675.1716\n",
      "2018-04-20, Close, 291.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-23, Cash 9582.171599999994 Value 133944.1716\n",
      "2018-04-23, Close, 294.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-24, Cash 9582.171599999994 Value 130137.1716\n",
      "2018-04-24, Close, 285.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-25, Cash 9582.171599999994 Value 128698.97159999999\n",
      "2018-04-25, Close, 281.60\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-26, Cash 9582.171599999994 Value 128022.1716\n",
      "2018-04-26, Close, 280.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-27, Cash 9582.171599999994 Value 128868.1716\n",
      "2018-04-27, Close, 282.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-04-30, Cash 9582.171599999994 Value 130137.1716\n",
      "2018-04-30, Close, 285.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-05-02, Cash 9582.171599999994 Value 129291.1716\n",
      "2018-05-02, Close, 283.00\n",
      "Max price: 305.4\n",
      "Min price: 278.0\n",
      "2018-05-03, Cash 9582.171599999994 Value 125907.1716\n",
      "2018-05-03, Close, 275.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-03, SELL CREATE, 275.00\n",
      "2018-05-04, SELL EXECUTED, Price: 276.00, Cost: 3948.14, Comm 29.81\n",
      "2018-05-04, Cash 14520.363599999993 Value 126057.36359999998\n",
      "2018-05-04, Close, 275.40\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-07, Cash 14520.363599999993 Value 127515.3636\n",
      "2018-05-07, Close, 279.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-08, Cash 14520.363599999993 Value 127110.3636\n",
      "2018-05-08, Close, 278.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2018-05-09, Cash 14520.363599999993 Value 129135.3636\n",
      "2018-05-09, Close, 283.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-10, Cash 14520.363599999993 Value 127839.3636\n",
      "2018-05-10, Close, 279.80\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-11, Cash 14520.363599999993 Value 129945.3636\n",
      "2018-05-11, Close, 285.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-15, Cash 14520.363599999993 Value 129135.3636\n",
      "2018-05-15, Close, 283.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-16, Cash 14520.363599999993 Value 130593.36360000001\n",
      "2018-05-16, Close, 286.60\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-17, Cash 14520.363599999993 Value 129945.3636\n",
      "2018-05-17, Close, 285.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-18, Cash 14520.363599999993 Value 129945.3636\n",
      "2018-05-18, Close, 285.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-21, Cash 14520.363599999993 Value 127920.3636\n",
      "2018-05-21, Close, 280.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-22, Cash 14520.363599999993 Value 129540.3636\n",
      "2018-05-22, Close, 284.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-23, Cash 14520.363599999993 Value 130755.3636\n",
      "2018-05-23, Close, 287.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-24, Cash 14520.363599999993 Value 129945.3636\n",
      "2018-05-24, Close, 285.00\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-25, Cash 14520.363599999993 Value 128406.3636\n",
      "2018-05-25, Close, 281.20\n",
      "Max price: 300.0\n",
      "Min price: 275.0\n",
      "2018-05-28, Cash 14520.363599999993 Value 128082.36359999998\n",
      "2018-05-28, Close, 280.40\n",
      "Max price: 294.2\n",
      "Min price: 275.0\n",
      "2018-05-29, Cash 14520.363599999993 Value 129135.3636\n",
      "2018-05-29, Close, 283.00\n",
      "Max price: 294.2\n",
      "Min price: 275.0\n",
      "2018-05-30, Cash 14520.363599999993 Value 127920.3636\n",
      "2018-05-30, Close, 280.00\n",
      "Max price: 294.2\n",
      "Min price: 275.0\n",
      "2018-05-31, Cash 14520.363599999993 Value 125490.3636\n",
      "2018-05-31, Close, 274.00\n",
      "Max price: 294.2\n",
      "Min price: 274.0\n",
      "2018-05-31, SELL CREATE, 274.00\n",
      "2018-06-01, SELL EXECUTED, Price: 280.00, Cost: 3948.14, Comm 30.24\n",
      "2018-06-01, Cash 19530.12359999999 Value 129360.7236\n",
      "2018-06-01, Close, 283.80\n",
      "Max price: 294.0\n",
      "Min price: 274.0\n",
      "2018-06-04, Cash 19530.12359999999 Value 128044.92359999998\n",
      "2018-06-04, Close, 280.40\n",
      "Max price: 294.0\n",
      "Min price: 274.0\n",
      "2018-06-05, Cash 19530.12359999999 Value 127967.52359999999\n",
      "2018-06-05, Close, 280.20\n",
      "Max price: 294.0\n",
      "Min price: 274.0\n",
      "2018-06-06, Cash 19530.12359999999 Value 128199.7236\n",
      "2018-06-06, Close, 280.80\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-07, Cash 19530.12359999999 Value 128896.3236\n",
      "2018-06-07, Close, 282.60\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-08, Cash 19530.12359999999 Value 129438.12359999999\n",
      "2018-06-08, Close, 284.00\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-11, Cash 19530.12359999999 Value 129825.12359999999\n",
      "2018-06-11, Close, 285.00\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-13, Cash 19530.12359999999 Value 127503.12359999999\n",
      "2018-06-13, Close, 279.00\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-14, Cash 19530.12359999999 Value 127580.52359999999\n",
      "2018-06-14, Close, 279.20\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-18, Cash 19530.12359999999 Value 126806.52359999999\n",
      "2018-06-18, Close, 277.20\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-19, Cash 19530.12359999999 Value 129438.12359999999\n",
      "2018-06-19, Close, 284.00\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-20, Cash 19530.12359999999 Value 127503.12359999999\n",
      "2018-06-20, Close, 279.00\n",
      "Max price: 287.0\n",
      "Min price: 274.0\n",
      "2018-06-21, Cash 19530.12359999999 Value 124020.12359999999\n",
      "2018-06-21, Close, 270.00\n",
      "Max price: 287.0\n",
      "Min price: 270.0\n",
      "2018-06-21, SELL CREATE, 270.00\n",
      "2018-06-22, SELL EXECUTED, Price: 270.00, Cost: 3948.14, Comm 29.16\n",
      "2018-06-22, Cash 24360.963599999992 Value 122883.96359999999\n",
      "2018-06-22, Close, 267.00\n",
      "Max price: 287.0\n",
      "Min price: 267.0\n",
      "2018-06-22, SELL CREATE, 267.00\n",
      "2018-06-25, SELL EXECUTED, Price: 275.00, Cost: 3948.14, Comm 29.70\n",
      "2018-06-25, Cash 29281.26359999999 Value 123489.66359999999\n",
      "2018-06-25, Close, 268.40\n",
      "Max price: 287.0\n",
      "Min price: 267.0\n",
      "2018-06-26, Cash 29281.26359999999 Value 124261.8636\n",
      "2018-06-26, Close, 270.60\n",
      "Max price: 287.0\n",
      "Min price: 267.0\n",
      "2018-06-27, Cash 29281.26359999999 Value 124402.26359999999\n",
      "2018-06-27, Close, 271.00\n",
      "Max price: 287.0\n",
      "Min price: 267.0\n",
      "2018-06-28, Cash 29281.26359999999 Value 120400.8636\n",
      "2018-06-28, Close, 259.60\n",
      "Max price: 287.0\n",
      "Min price: 259.6\n",
      "2018-06-28, SELL CREATE, 259.60\n",
      "2018-06-29, SELL EXECUTED, Price: 259.80, Cost: 4167.48, Comm 29.62\n",
      "2018-06-29, Cash 34187.84639999999 Value 121503.84639999998\n",
      "2018-06-29, Close, 263.00\n",
      "Max price: 287.0\n",
      "Min price: 259.6\n",
      "2018-07-02, Cash 34187.84639999999 Value 120507.84639999998\n",
      "2018-07-02, Close, 260.00\n",
      "Max price: 287.0\n",
      "Min price: 259.6\n",
      "2018-07-03, Cash 34187.84639999999 Value 120507.84639999998\n",
      "2018-07-03, Close, 260.00\n",
      "Max price: 287.0\n",
      "Min price: 259.6\n",
      "2018-07-04, Cash 34187.84639999999 Value 120441.44639999999\n",
      "2018-07-04, Close, 259.80\n",
      "Max price: 287.0\n",
      "Min price: 259.6\n",
      "2018-07-05, Cash 34187.84639999999 Value 118515.84639999998\n",
      "2018-07-05, Close, 254.00\n",
      "Max price: 287.0\n",
      "Min price: 254.0\n",
      "2018-07-05, SELL CREATE, 254.00\n",
      "2018-07-06, SELL EXECUTED, Price: 254.00, Cost: 4167.48, Comm 28.96\n",
      "2018-07-06, Cash 38984.89039999999 Value 117547.89039999999\n",
      "2018-07-06, Close, 251.00\n",
      "Max price: 285.0\n",
      "Min price: 251.0\n",
      "2018-07-06, SELL CREATE, 251.00\n",
      "2018-07-09, SELL EXECUTED, Price: 251.80, Cost: 4167.48, Comm 28.71\n",
      "2018-07-09, Cash 43740.38519999999 Value 115770.38519999999\n",
      "2018-07-09, Close, 245.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-09, SELL CREATE, 245.00\n",
      "2018-07-10, SELL EXECUTED, Price: 245.20, Cost: 4386.82, Comm 29.42\n",
      "2018-07-10, Cash 48614.96119999999 Value 116018.96119999999\n",
      "2018-07-10, Close, 246.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-11, Cash 48614.96119999999 Value 116347.7612\n",
      "2018-07-11, Close, 247.20\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-12, Cash 48614.96119999999 Value 117060.16119999999\n",
      "2018-07-12, Close, 249.80\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-13, Cash 48614.96119999999 Value 117608.16119999999\n",
      "2018-07-13, Close, 251.80\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-16, Cash 48614.96119999999 Value 116786.16119999999\n",
      "2018-07-16, Close, 248.80\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-17, Cash 48614.96119999999 Value 117827.36119999998\n",
      "2018-07-17, Close, 252.60\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-18, Cash 48614.96119999999 Value 118265.7612\n",
      "2018-07-18, Close, 254.20\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-19, Cash 48614.96119999999 Value 117936.96119999999\n",
      "2018-07-19, Close, 253.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-20, Cash 48614.96119999999 Value 117114.96119999999\n",
      "2018-07-20, Close, 250.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-23, Cash 48614.96119999999 Value 117114.96119999999\n",
      "2018-07-23, Close, 250.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-24, Cash 48614.96119999999 Value 117388.96119999999\n",
      "2018-07-24, Close, 251.00\n",
      "Max price: 285.0\n",
      "Min price: 245.0\n",
      "2018-07-25, Cash 48614.96119999999 Value 117443.7612\n",
      "2018-07-25, Close, 251.20\n",
      "Max price: 284.0\n",
      "Min price: 245.0\n",
      "2018-07-26, Cash 48614.96119999999 Value 118813.7612\n",
      "2018-07-26, Close, 256.20\n",
      "Max price: 284.0\n",
      "Min price: 245.0\n",
      "2018-07-27, Cash 48614.96119999999 Value 121498.96119999999\n",
      "2018-07-27, Close, 266.00\n",
      "Max price: 284.0\n",
      "Min price: 245.0\n",
      "2018-07-30, Cash 48614.96119999999 Value 121498.96119999999\n",
      "2018-07-30, Close, 266.00\n",
      "Max price: 284.0\n",
      "Min price: 245.0\n",
      "2018-07-31, Cash 48614.96119999999 Value 122594.96119999999\n",
      "2018-07-31, Close, 270.00\n",
      "Max price: 279.0\n",
      "Min price: 245.0\n",
      "2018-08-01, Cash 48614.96119999999 Value 125170.56119999998\n",
      "2018-08-01, Close, 279.40\n",
      "Max price: 279.4\n",
      "Min price: 245.0\n",
      "2018-08-01, BUY CREATE, 279.40\n",
      "2018-08-02, BUY EXECUTED, Price: 279.00, Cost: 9765.00, Comm 58.59\n",
      "2018-08-02, Cash 38791.371199999994 Value 124075.3712\n",
      "2018-08-02, Close, 276.00\n",
      "Max price: 279.4\n",
      "Min price: 245.0\n",
      "2018-08-03, Cash 38791.371199999994 Value 124384.3712\n",
      "2018-08-03, Close, 277.00\n",
      "Max price: 279.4\n",
      "Min price: 245.0\n",
      "2018-08-06, Cash 38791.371199999994 Value 125311.3712\n",
      "2018-08-06, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-06, BUY CREATE, 280.00\n",
      "2018-08-07, BUY EXECUTED, Price: 279.80, Cost: 9793.00, Comm 58.76\n",
      "2018-08-07, Cash 28939.613199999993 Value 121819.61319999999\n",
      "2018-08-07, Close, 270.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-08, Cash 28939.613199999993 Value 124158.81319999999\n",
      "2018-08-08, Close, 276.80\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-09, Cash 28939.613199999993 Value 121475.61319999999\n",
      "2018-08-09, Close, 269.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-10, Cash 28939.613199999993 Value 120787.61319999999\n",
      "2018-08-10, Close, 267.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-13, Cash 28939.613199999993 Value 121819.61319999999\n",
      "2018-08-13, Close, 270.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-14, Cash 28939.613199999993 Value 122989.21319999998\n",
      "2018-08-14, Close, 273.40\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-15, Cash 28939.613199999993 Value 123195.61319999999\n",
      "2018-08-15, Close, 274.00\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-16, Cash 28939.613199999993 Value 120718.81319999999\n",
      "2018-08-16, Close, 266.80\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-17, Cash 28939.613199999993 Value 122232.4132\n",
      "2018-08-17, Close, 271.20\n",
      "Max price: 280.0\n",
      "Min price: 245.0\n",
      "2018-08-20, Cash 28939.613199999993 Value 122851.61319999999\n",
      "2018-08-20, Close, 273.00\n",
      "Max price: 280.0\n",
      "Min price: 246.0\n",
      "2018-08-22, Cash 28939.613199999993 Value 127323.61319999999\n",
      "2018-08-22, Close, 286.00\n",
      "Max price: 286.0\n",
      "Min price: 247.2\n",
      "2018-08-22, BUY CREATE, 286.00\n",
      "2018-08-23, BUY EXECUTED, Price: 287.00, Cost: 9758.00, Comm 58.55\n",
      "2018-08-23, Cash 19123.065199999994 Value 129877.0652\n",
      "2018-08-23, Close, 293.00\n",
      "Max price: 293.0\n",
      "Min price: 248.8\n",
      "2018-08-23, BUY CREATE, 293.00\n",
      "2018-08-24, BUY EXECUTED, Price: 293.00, Cost: 9962.00, Comm 59.77\n",
      "2018-08-24, Cash 9101.293199999993 Value 127757.29319999999\n",
      "2018-08-24, Close, 288.00\n",
      "Max price: 293.0\n",
      "Min price: 248.8\n",
      "2018-08-28, Cash 9101.293199999993 Value 128663.69319999998\n",
      "2018-08-28, Close, 290.20\n",
      "Max price: 293.0\n",
      "Min price: 248.8\n",
      "2018-08-29, Cash 9101.293199999993 Value 127510.09319999997\n",
      "2018-08-29, Close, 287.40\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-08-30, Cash 9101.293199999993 Value 126933.29319999999\n",
      "2018-08-30, Close, 286.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-08-31, Cash 9101.293199999993 Value 127757.29319999999\n",
      "2018-08-31, Close, 288.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-09-03, Cash 9101.293199999993 Value 125285.29319999999\n",
      "2018-09-03, Close, 282.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-09-04, Cash 9101.293199999993 Value 127180.4932\n",
      "2018-09-04, Close, 286.60\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-09-05, Cash 9101.293199999993 Value 126521.29319999999\n",
      "2018-09-05, Close, 285.00\n",
      "Max price: 293.0\n",
      "Min price: 251.0\n",
      "2018-09-06, Cash 9101.293199999993 Value 122813.29319999999\n",
      "2018-09-06, Close, 276.00\n",
      "Max price: 293.0\n",
      "Min price: 251.2\n",
      "2018-09-07, Cash 9101.293199999993 Value 124873.29319999999\n",
      "2018-09-07, Close, 281.00\n",
      "Max price: 293.0\n",
      "Min price: 256.2\n",
      "2018-09-10, Cash 9101.293199999993 Value 123802.09319999997\n",
      "2018-09-10, Close, 278.40\n",
      "Max price: 293.0\n",
      "Min price: 266.0\n",
      "2018-09-11, Cash 9101.293199999993 Value 122813.29319999999\n",
      "2018-09-11, Close, 276.00\n",
      "Max price: 293.0\n",
      "Min price: 266.0\n",
      "2018-09-12, Cash 9101.293199999993 Value 119929.29319999999\n",
      "2018-09-12, Close, 269.00\n",
      "Max price: 293.0\n",
      "Min price: 266.8\n",
      "2018-09-13, Cash 9101.293199999993 Value 123225.29319999999\n",
      "2018-09-13, Close, 277.00\n",
      "Max price: 293.0\n",
      "Min price: 266.8\n",
      "2018-09-14, Cash 9101.293199999993 Value 119929.29319999999\n",
      "2018-09-14, Close, 269.00\n",
      "Max price: 293.0\n",
      "Min price: 266.8\n",
      "2018-09-17, Cash 9101.293199999993 Value 122401.29319999999\n",
      "2018-09-17, Close, 275.00\n",
      "Max price: 293.0\n",
      "Min price: 266.8\n",
      "2018-09-18, Cash 9101.293199999993 Value 121165.29319999999\n",
      "2018-09-18, Close, 272.00\n",
      "Max price: 293.0\n",
      "Min price: 266.8\n",
      "2018-09-19, Cash 9101.293199999993 Value 117869.29319999999\n",
      "2018-09-19, Close, 264.00\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-19, SELL CREATE, 264.00\n",
      "2018-09-20, SELL EXECUTED, Price: 271.00, Cost: 4341.73, Comm 29.27\n",
      "2018-09-20, Cash 13950.025199999993 Value 120724.02519999999\n",
      "2018-09-20, Close, 271.00\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-21, Cash 13950.025199999993 Value 121118.02519999999\n",
      "2018-09-21, Close, 272.00\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-24, Cash 13950.025199999993 Value 120724.02519999999\n",
      "2018-09-24, Close, 271.00\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-25, Cash 13950.025199999993 Value 119857.2252\n",
      "2018-09-25, Close, 268.80\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-26, Cash 13950.025199999993 Value 118832.82519999998\n",
      "2018-09-26, Close, 266.20\n",
      "Max price: 293.0\n",
      "Min price: 264.0\n",
      "2018-09-27, Cash 13950.025199999993 Value 115996.02519999999\n",
      "2018-09-27, Close, 259.00\n",
      "Max price: 293.0\n",
      "Min price: 259.0\n",
      "2018-09-27, SELL CREATE, 259.00\n",
      "2018-09-28, SELL EXECUTED, Price: 262.00, Cost: 4582.94, Comm 29.87\n",
      "2018-09-28, Cash 18898.157199999994 Value 115273.15719999999\n",
      "2018-09-28, Close, 257.00\n",
      "Max price: 293.0\n",
      "Min price: 257.0\n",
      "2018-09-28, SELL CREATE, 257.00\n",
      "2018-10-01, SELL EXECUTED, Price: 257.20, Cost: 4582.94, Comm 29.32\n",
      "2018-10-01, Cash 23755.636399999992 Value 113467.63639999999\n",
      "2018-10-01, Close, 252.00\n",
      "Max price: 293.0\n",
      "Min price: 252.0\n",
      "2018-10-01, SELL CREATE, 252.00\n",
      "2018-10-02, SELL EXECUTED, Price: 252.20, Cost: 4582.94, Comm 28.75\n",
      "2018-10-02, Cash 28518.68559999999 Value 112768.6856\n",
      "2018-10-02, Close, 250.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-10-02, SELL CREATE, 250.00\n",
      "2018-10-03, SELL EXECUTED, Price: 251.00, Cost: 4824.15, Comm 30.12\n",
      "2018-10-03, Cash 33508.56559999999 Value 113392.56559999999\n",
      "2018-10-03, Close, 252.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-10-04, Cash 33508.56559999999 Value 113392.56559999999\n",
      "2018-10-04, Close, 252.00\n",
      "Max price: 293.0\n",
      "Min price: 250.0\n",
      "2018-10-05, Cash 33508.56559999999 Value 111807.56559999999\n",
      "2018-10-05, Close, 247.00\n",
      "Max price: 290.2\n",
      "Min price: 247.0\n",
      "2018-10-05, SELL CREATE, 247.00\n",
      "2018-10-08, SELL EXECUTED, Price: 247.00, Cost: 4824.15, Comm 29.64\n",
      "2018-10-08, Cash 38418.92559999999 Value 110589.92559999999\n",
      "2018-10-08, Close, 243.00\n",
      "Max price: 290.2\n",
      "Min price: 243.0\n",
      "2018-10-08, SELL CREATE, 243.00\n",
      "2018-10-09, SELL EXECUTED, Price: 243.20, Cost: 4824.15, Comm 29.18\n",
      "2018-10-09, Cash 43253.74159999999 Value 113168.5416\n",
      "2018-10-09, Close, 252.40\n",
      "Max price: 288.0\n",
      "Min price: 243.0\n",
      "2018-10-10, Cash 43253.74159999999 Value 113611.74159999998\n",
      "2018-10-10, Close, 254.00\n",
      "Max price: 288.0\n",
      "Min price: 243.0\n",
      "2018-10-11, Cash 43253.74159999999 Value 113611.74159999998\n",
      "2018-10-11, Close, 254.00\n",
      "Max price: 288.0\n",
      "Min price: 243.0\n",
      "2018-10-12, Cash 43253.74159999999 Value 115827.74159999998\n",
      "2018-10-12, Close, 262.00\n",
      "Max price: 286.6\n",
      "Min price: 243.0\n",
      "2018-10-15, Cash 43253.74159999999 Value 112503.74159999998\n",
      "2018-10-15, Close, 250.00\n",
      "Max price: 286.6\n",
      "Min price: 243.0\n",
      "2018-10-16, Cash 43253.74159999999 Value 113667.14159999997\n",
      "2018-10-16, Close, 254.20\n",
      "Max price: 285.0\n",
      "Min price: 243.0\n",
      "2018-10-17, Cash 43253.74159999999 Value 114885.94159999999\n",
      "2018-10-17, Close, 258.60\n",
      "Max price: 281.0\n",
      "Min price: 243.0\n",
      "2018-10-18, Cash 43253.74159999999 Value 115273.74159999998\n",
      "2018-10-18, Close, 260.00\n",
      "Max price: 281.0\n",
      "Min price: 243.0\n",
      "2018-10-19, Cash 43253.74159999999 Value 116658.74159999998\n",
      "2018-10-19, Close, 265.00\n",
      "Max price: 278.4\n",
      "Min price: 243.0\n",
      "2018-10-22, Cash 43253.74159999999 Value 118597.74159999998\n",
      "2018-10-22, Close, 272.00\n",
      "Max price: 277.0\n",
      "Min price: 243.0\n",
      "2018-10-23, Cash 43253.74159999999 Value 117489.74159999998\n",
      "2018-10-23, Close, 268.00\n",
      "Max price: 277.0\n",
      "Min price: 243.0\n",
      "2018-10-24, Cash 43253.74159999999 Value 116437.14159999997\n",
      "2018-10-24, Close, 264.20\n",
      "Max price: 277.0\n",
      "Min price: 243.0\n",
      "2018-10-25, Cash 43253.74159999999 Value 115827.74159999998\n",
      "2018-10-25, Close, 262.00\n",
      "Max price: 275.0\n",
      "Min price: 243.0\n",
      "2018-10-26, Cash 43253.74159999999 Value 118043.74159999998\n",
      "2018-10-26, Close, 270.00\n",
      "Max price: 275.0\n",
      "Min price: 243.0\n",
      "2018-10-29, Cash 43253.74159999999 Value 118043.74159999998\n",
      "2018-10-29, Close, 270.00\n",
      "Max price: 272.0\n",
      "Min price: 243.0\n",
      "2018-10-30, Cash 43253.74159999999 Value 116381.74159999998\n",
      "2018-10-30, Close, 264.00\n",
      "Max price: 272.0\n",
      "Min price: 243.0\n",
      "2018-10-31, Cash 43253.74159999999 Value 119705.74159999998\n",
      "2018-10-31, Close, 276.00\n",
      "Max price: 276.0\n",
      "Min price: 243.0\n",
      "2018-10-31, BUY CREATE, 276.00\n",
      "2018-11-05, BUY EXECUTED, Price: 275.00, Cost: 9900.00, Comm 59.40\n",
      "2018-11-05, Cash 33294.341599999985 Value 120934.34159999999\n",
      "2018-11-05, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-05, BUY CREATE, 280.00\n",
      "2018-11-06, BUY EXECUTED, Price: 280.00, Cost: 9800.00, Comm 58.80\n",
      "2018-11-06, Cash 23435.541599999986 Value 120388.34159999999\n",
      "2018-11-06, Close, 278.60\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-07, Cash 23435.541599999986 Value 120875.54159999998\n",
      "2018-11-07, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-07, BUY CREATE, 280.00\n",
      "2018-11-08, BUY EXECUTED, Price: 278.80, Cost: 9758.00, Comm 58.55\n",
      "2018-11-08, Cash 13618.993599999985 Value 120858.99359999999\n",
      "2018-11-08, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-08, BUY CREATE, 280.00\n",
      "2018-11-09, BUY EXECUTED, Price: 279.00, Cost: 9765.00, Comm 58.59\n",
      "2018-11-09, Cash 3795.403599999985 Value 119999.40359999999\n",
      "2018-11-09, Close, 278.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-12, Cash 3795.403599999985 Value 118327.40359999999\n",
      "2018-11-12, Close, 274.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-13, Cash 3795.403599999985 Value 117825.8036\n",
      "2018-11-13, Close, 272.80\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-14, Cash 3795.403599999985 Value 120417.40359999999\n",
      "2018-11-14, Close, 279.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-15, Cash 3795.403599999985 Value 120835.40359999999\n",
      "2018-11-15, Close, 280.00\n",
      "Max price: 280.0\n",
      "Min price: 243.0\n",
      "2018-11-15, BUY CREATE, 280.00\n",
      "2018-11-16, BUY EXECUTED, Price: 284.80, Cost: 3702.40, Comm 22.21\n",
      "2018-11-16, Cash 70.789199999985 Value 121612.78919999998\n",
      "2018-11-16, Close, 282.00\n",
      "Max price: 282.0\n",
      "Min price: 243.0\n",
      "2018-11-19, Cash 70.789199999985 Value 121612.78919999998\n",
      "2018-11-19, Close, 282.00\n",
      "Max price: 282.0\n",
      "Min price: 243.0\n",
      "2018-11-20, Cash 70.789199999985 Value 120319.78919999998\n",
      "2018-11-20, Close, 279.00\n",
      "Max price: 282.0\n",
      "Min price: 243.0\n",
      "2018-11-21, Cash 70.789199999985 Value 121612.78919999998\n",
      "2018-11-21, Close, 282.00\n",
      "Max price: 282.0\n",
      "Min price: 250.0\n",
      "2018-11-22, Cash 70.789199999985 Value 122905.78919999998\n",
      "2018-11-22, Close, 285.00\n",
      "Max price: 285.0\n",
      "Min price: 250.0\n",
      "2018-11-23, Cash 70.789199999985 Value 122043.78919999998\n",
      "2018-11-23, Close, 283.00\n",
      "Max price: 285.0\n",
      "Min price: 250.0\n",
      "2018-11-26, Cash 70.789199999985 Value 120750.78919999998\n",
      "2018-11-26, Close, 280.00\n",
      "Max price: 285.0\n",
      "Min price: 250.0\n",
      "2018-11-27, Cash 70.789199999985 Value 122043.78919999998\n",
      "2018-11-27, Close, 283.00\n",
      "Max price: 285.0\n",
      "Min price: 250.0\n",
      "2018-11-28, Cash 70.789199999985 Value 120750.78919999998\n",
      "2018-11-28, Close, 280.00\n",
      "Max price: 285.0\n",
      "Min price: 254.2\n",
      "2018-11-29, Cash 70.789199999985 Value 120061.18919999998\n",
      "2018-11-29, Close, 278.40\n",
      "Max price: 285.0\n",
      "Min price: 258.6\n",
      "2018-12-03, Cash 70.789199999985 Value 123681.58919999999\n",
      "2018-12-03, Close, 286.80\n",
      "Max price: 286.8\n",
      "Min price: 260.0\n",
      "2018-12-04, Cash 70.789199999985 Value 124888.38919999999\n",
      "2018-12-04, Close, 289.60\n",
      "Max price: 289.6\n",
      "Min price: 262.0\n",
      "2018-12-05, Cash 70.789199999985 Value 126784.78919999998\n",
      "2018-12-05, Close, 294.00\n",
      "Max price: 294.0\n",
      "Min price: 262.0\n",
      "2018-12-06, Cash 70.789199999985 Value 127646.78919999998\n",
      "2018-12-06, Close, 296.00\n",
      "Max price: 296.0\n",
      "Min price: 262.0\n",
      "2018-12-07, Cash 70.789199999985 Value 127215.78919999998\n",
      "2018-12-07, Close, 295.00\n",
      "Max price: 296.0\n",
      "Min price: 262.0\n",
      "2018-12-10, Cash 70.789199999985 Value 125491.78919999998\n",
      "2018-12-10, Close, 291.00\n",
      "Max price: 296.0\n",
      "Min price: 262.0\n",
      "2018-12-11, Cash 70.789199999985 Value 128077.78919999998\n",
      "2018-12-11, Close, 297.00\n",
      "Max price: 297.0\n",
      "Min price: 264.0\n",
      "2018-12-12, Cash 70.789199999985 Value 126784.78919999998\n",
      "2018-12-12, Close, 294.00\n",
      "Max price: 297.0\n",
      "Min price: 264.0\n",
      "2018-12-13, Cash 70.789199999985 Value 127043.38919999999\n",
      "2018-12-13, Close, 294.60\n",
      "Max price: 297.0\n",
      "Min price: 264.0\n",
      "2018-12-14, Cash 70.789199999985 Value 128508.78919999998\n",
      "2018-12-14, Close, 298.00\n",
      "Max price: 298.0\n",
      "Min price: 272.8\n",
      "2018-12-17, Cash 70.789199999985 Value 129370.78919999998\n",
      "2018-12-17, Close, 300.00\n",
      "Max price: 300.0\n",
      "Min price: 272.8\n",
      "2018-12-18, Cash 70.789199999985 Value 129887.98919999997\n",
      "2018-12-18, Close, 301.20\n",
      "Max price: 301.2\n",
      "Min price: 272.8\n",
      "2018-12-19, Cash 70.789199999985 Value 131525.7892\n",
      "2018-12-19, Close, 305.00\n",
      "Max price: 305.0\n",
      "Min price: 272.8\n",
      "2018-12-20, Cash 70.789199999985 Value 130663.78919999998\n",
      "2018-12-20, Close, 303.00\n",
      "Max price: 305.0\n",
      "Min price: 272.8\n",
      "2018-12-21, Cash 70.789199999985 Value 130405.18919999998\n",
      "2018-12-21, Close, 302.40\n",
      "Max price: 305.0\n",
      "Min price: 272.8\n",
      "2018-12-26, Cash 70.789199999985 Value 125922.78919999998\n",
      "2018-12-26, Close, 292.00\n",
      "Max price: 305.0\n",
      "Min price: 272.8\n",
      "2018-12-27, Cash 70.789199999985 Value 127215.78919999998\n",
      "2018-12-27, Close, 295.00\n",
      "Max price: 305.0\n",
      "Min price: 272.8\n",
      "2018-12-28, Cash 70.789199999985 Value 125836.58919999999\n",
      "2018-12-28, Close, 291.80\n",
      "Max price: 305.0\n",
      "Min price: 278.4\n",
      "Final Portfolio Value: 125836.59\n"
     ]
    },
    {
     "data": {
      "application/javascript": [
       "/* Put everything inside the global mpl namespace */\n",
       "window.mpl = {};\n",
       "\n",
       "\n",
       "mpl.get_websocket_type = function() {\n",
       "    if (typeof(WebSocket) !== 'undefined') {\n",
       "        return WebSocket;\n",
       "    } else if (typeof(MozWebSocket) !== 'undefined') {\n",
       "        return MozWebSocket;\n",
       "    } else {\n",
       "        alert('Your browser does not have WebSocket support. ' +\n",
       "              'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
       "              'Firefox 4 and 5 are also supported but you ' +\n",
       "              'have to enable WebSockets in about:config.');\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
       "    this.id = figure_id;\n",
       "\n",
       "    this.ws = websocket;\n",
       "\n",
       "    this.supports_binary = (this.ws.binaryType != undefined);\n",
       "\n",
       "    if (!this.supports_binary) {\n",
       "        var warnings = document.getElementById(\"mpl-warnings\");\n",
       "        if (warnings) {\n",
       "            warnings.style.display = 'block';\n",
       "            warnings.textContent = (\n",
       "                \"This browser does not support binary websocket messages. \" +\n",
       "                    \"Performance may be slow.\");\n",
       "        }\n",
       "    }\n",
       "\n",
       "    this.imageObj = new Image();\n",
       "\n",
       "    this.context = undefined;\n",
       "    this.message = undefined;\n",
       "    this.canvas = undefined;\n",
       "    this.rubberband_canvas = undefined;\n",
       "    this.rubberband_context = undefined;\n",
       "    this.format_dropdown = undefined;\n",
       "\n",
       "    this.image_mode = 'full';\n",
       "\n",
       "    this.root = $('<div/>');\n",
       "    this._root_extra_style(this.root)\n",
       "    this.root.attr('style', 'display: inline-block');\n",
       "\n",
       "    $(parent_element).append(this.root);\n",
       "\n",
       "    this._init_header(this);\n",
       "    this._init_canvas(this);\n",
       "    this._init_toolbar(this);\n",
       "\n",
       "    var fig = this;\n",
       "\n",
       "    this.waiting = false;\n",
       "\n",
       "    this.ws.onopen =  function () {\n",
       "            fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
       "            fig.send_message(\"send_image_mode\", {});\n",
       "            if (mpl.ratio != 1) {\n",
       "                fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
       "            }\n",
       "            fig.send_message(\"refresh\", {});\n",
       "        }\n",
       "\n",
       "    this.imageObj.onload = function() {\n",
       "            if (fig.image_mode == 'full') {\n",
       "                // Full images could contain transparency (where diff images\n",
       "                // almost always do), so we need to clear the canvas so that\n",
       "                // there is no ghosting.\n",
       "                fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
       "            }\n",
       "            fig.context.drawImage(fig.imageObj, 0, 0);\n",
       "        };\n",
       "\n",
       "    this.imageObj.onunload = function() {\n",
       "        fig.ws.close();\n",
       "    }\n",
       "\n",
       "    this.ws.onmessage = this._make_on_message_function(this);\n",
       "\n",
       "    this.ondownload = ondownload;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_header = function() {\n",
       "    var titlebar = $(\n",
       "        '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n",
       "        'ui-helper-clearfix\"/>');\n",
       "    var titletext = $(\n",
       "        '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n",
       "        'text-align: center; padding: 3px;\"/>');\n",
       "    titlebar.append(titletext)\n",
       "    this.root.append(titlebar);\n",
       "    this.header = titletext[0];\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_canvas = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var canvas_div = $('<div/>');\n",
       "\n",
       "    canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
       "\n",
       "    function canvas_keyboard_event(event) {\n",
       "        return fig.key_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    canvas_div.keydown('key_press', canvas_keyboard_event);\n",
       "    canvas_div.keyup('key_release', canvas_keyboard_event);\n",
       "    this.canvas_div = canvas_div\n",
       "    this._canvas_extra_style(canvas_div)\n",
       "    this.root.append(canvas_div);\n",
       "\n",
       "    var canvas = $('<canvas/>');\n",
       "    canvas.addClass('mpl-canvas');\n",
       "    canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
       "\n",
       "    this.canvas = canvas[0];\n",
       "    this.context = canvas[0].getContext(\"2d\");\n",
       "\n",
       "    var backingStore = this.context.backingStorePixelRatio ||\n",
       "\tthis.context.webkitBackingStorePixelRatio ||\n",
       "\tthis.context.mozBackingStorePixelRatio ||\n",
       "\tthis.context.msBackingStorePixelRatio ||\n",
       "\tthis.context.oBackingStorePixelRatio ||\n",
       "\tthis.context.backingStorePixelRatio || 1;\n",
       "\n",
       "    mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
       "\n",
       "    var rubberband = $('<canvas/>');\n",
       "    rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
       "\n",
       "    var pass_mouse_events = true;\n",
       "\n",
       "    canvas_div.resizable({\n",
       "        start: function(event, ui) {\n",
       "            pass_mouse_events = false;\n",
       "        },\n",
       "        resize: function(event, ui) {\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "        stop: function(event, ui) {\n",
       "            pass_mouse_events = true;\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "    });\n",
       "\n",
       "    function mouse_event_fn(event) {\n",
       "        if (pass_mouse_events)\n",
       "            return fig.mouse_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    rubberband.mousedown('button_press', mouse_event_fn);\n",
       "    rubberband.mouseup('button_release', mouse_event_fn);\n",
       "    // Throttle sequential mouse events to 1 every 20ms.\n",
       "    rubberband.mousemove('motion_notify', mouse_event_fn);\n",
       "\n",
       "    rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
       "    rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
       "\n",
       "    canvas_div.on(\"wheel\", function (event) {\n",
       "        event = event.originalEvent;\n",
       "        event['data'] = 'scroll'\n",
       "        if (event.deltaY < 0) {\n",
       "            event.step = 1;\n",
       "        } else {\n",
       "            event.step = -1;\n",
       "        }\n",
       "        mouse_event_fn(event);\n",
       "    });\n",
       "\n",
       "    canvas_div.append(canvas);\n",
       "    canvas_div.append(rubberband);\n",
       "\n",
       "    this.rubberband = rubberband;\n",
       "    this.rubberband_canvas = rubberband[0];\n",
       "    this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
       "    this.rubberband_context.strokeStyle = \"#000000\";\n",
       "\n",
       "    this._resize_canvas = function(width, height) {\n",
       "        // Keep the size of the canvas, canvas container, and rubber band\n",
       "        // canvas in synch.\n",
       "        canvas_div.css('width', width)\n",
       "        canvas_div.css('height', height)\n",
       "\n",
       "        canvas.attr('width', width * mpl.ratio);\n",
       "        canvas.attr('height', height * mpl.ratio);\n",
       "        canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
       "\n",
       "        rubberband.attr('width', width);\n",
       "        rubberband.attr('height', height);\n",
       "    }\n",
       "\n",
       "    // Set the figure to an initial 600x600px, this will subsequently be updated\n",
       "    // upon first draw.\n",
       "    this._resize_canvas(600, 600);\n",
       "\n",
       "    // Disable right mouse context menu.\n",
       "    $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
       "        return false;\n",
       "    });\n",
       "\n",
       "    function set_focus () {\n",
       "        canvas.focus();\n",
       "        canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    window.setTimeout(set_focus, 100);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items) {\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) {\n",
       "            // put a spacer in here.\n",
       "            continue;\n",
       "        }\n",
       "        var button = $('<button/>');\n",
       "        button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
       "                        'ui-button-icon-only');\n",
       "        button.attr('role', 'button');\n",
       "        button.attr('aria-disabled', 'false');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "\n",
       "        var icon_img = $('<span/>');\n",
       "        icon_img.addClass('ui-button-icon-primary ui-icon');\n",
       "        icon_img.addClass(image);\n",
       "        icon_img.addClass('ui-corner-all');\n",
       "\n",
       "        var tooltip_span = $('<span/>');\n",
       "        tooltip_span.addClass('ui-button-text');\n",
       "        tooltip_span.html(tooltip);\n",
       "\n",
       "        button.append(icon_img);\n",
       "        button.append(tooltip_span);\n",
       "\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    var fmt_picker_span = $('<span/>');\n",
       "\n",
       "    var fmt_picker = $('<select/>');\n",
       "    fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
       "    fmt_picker_span.append(fmt_picker);\n",
       "    nav_element.append(fmt_picker_span);\n",
       "    this.format_dropdown = fmt_picker[0];\n",
       "\n",
       "    for (var ind in mpl.extensions) {\n",
       "        var fmt = mpl.extensions[ind];\n",
       "        var option = $(\n",
       "            '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n",
       "        fmt_picker.append(option);\n",
       "    }\n",
       "\n",
       "    // Add hover states to the ui-buttons\n",
       "    $( \".ui-button\" ).hover(\n",
       "        function() { $(this).addClass(\"ui-state-hover\");},\n",
       "        function() { $(this).removeClass(\"ui-state-hover\");}\n",
       "    );\n",
       "\n",
       "    var status_bar = $('<span class=\"mpl-message\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
       "    // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
       "    // which will in turn request a refresh of the image.\n",
       "    this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_message = function(type, properties) {\n",
       "    properties['type'] = type;\n",
       "    properties['figure_id'] = this.id;\n",
       "    this.ws.send(JSON.stringify(properties));\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_draw_message = function() {\n",
       "    if (!this.waiting) {\n",
       "        this.waiting = true;\n",
       "        this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    var format_dropdown = fig.format_dropdown;\n",
       "    var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
       "    fig.ondownload(fig, format);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
       "    var size = msg['size'];\n",
       "    if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
       "        fig._resize_canvas(size[0], size[1]);\n",
       "        fig.send_message(\"refresh\", {});\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
       "    var x0 = msg['x0'] / mpl.ratio;\n",
       "    var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
       "    var x1 = msg['x1'] / mpl.ratio;\n",
       "    var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
       "    x0 = Math.floor(x0) + 0.5;\n",
       "    y0 = Math.floor(y0) + 0.5;\n",
       "    x1 = Math.floor(x1) + 0.5;\n",
       "    y1 = Math.floor(y1) + 0.5;\n",
       "    var min_x = Math.min(x0, x1);\n",
       "    var min_y = Math.min(y0, y1);\n",
       "    var width = Math.abs(x1 - x0);\n",
       "    var height = Math.abs(y1 - y0);\n",
       "\n",
       "    fig.rubberband_context.clearRect(\n",
       "        0, 0, fig.canvas.width / mpl.ratio, fig.canvas.height / mpl.ratio);\n",
       "\n",
       "    fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
       "    // Updates the figure title.\n",
       "    fig.header.textContent = msg['label'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
       "    var cursor = msg['cursor'];\n",
       "    switch(cursor)\n",
       "    {\n",
       "    case 0:\n",
       "        cursor = 'pointer';\n",
       "        break;\n",
       "    case 1:\n",
       "        cursor = 'default';\n",
       "        break;\n",
       "    case 2:\n",
       "        cursor = 'crosshair';\n",
       "        break;\n",
       "    case 3:\n",
       "        cursor = 'move';\n",
       "        break;\n",
       "    }\n",
       "    fig.rubberband_canvas.style.cursor = cursor;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_message = function(fig, msg) {\n",
       "    fig.message.textContent = msg['message'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
       "    // Request the server to send over a new figure.\n",
       "    fig.send_draw_message();\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
       "    fig.image_mode = msg['mode'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Called whenever the canvas gets updated.\n",
       "    this.send_message(\"ack\", {});\n",
       "}\n",
       "\n",
       "// A function to construct a web socket function for onmessage handling.\n",
       "// Called in the figure constructor.\n",
       "mpl.figure.prototype._make_on_message_function = function(fig) {\n",
       "    return function socket_on_message(evt) {\n",
       "        if (evt.data instanceof Blob) {\n",
       "            /* FIXME: We get \"Resource interpreted as Image but\n",
       "             * transferred with MIME type text/plain:\" errors on\n",
       "             * Chrome.  But how to set the MIME type?  It doesn't seem\n",
       "             * to be part of the websocket stream */\n",
       "            evt.data.type = \"image/png\";\n",
       "\n",
       "            /* Free the memory for the previous frames */\n",
       "            if (fig.imageObj.src) {\n",
       "                (window.URL || window.webkitURL).revokeObjectURL(\n",
       "                    fig.imageObj.src);\n",
       "            }\n",
       "\n",
       "            fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
       "                evt.data);\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "        else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
       "            fig.imageObj.src = evt.data;\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        var msg = JSON.parse(evt.data);\n",
       "        var msg_type = msg['type'];\n",
       "\n",
       "        // Call the  \"handle_{type}\" callback, which takes\n",
       "        // the figure and JSON message as its only arguments.\n",
       "        try {\n",
       "            var callback = fig[\"handle_\" + msg_type];\n",
       "        } catch (e) {\n",
       "            console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        if (callback) {\n",
       "            try {\n",
       "                // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
       "                callback(fig, msg);\n",
       "            } catch (e) {\n",
       "                console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
       "            }\n",
       "        }\n",
       "    };\n",
       "}\n",
       "\n",
       "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
       "mpl.findpos = function(e) {\n",
       "    //this section is from http://www.quirksmode.org/js/events_properties.html\n",
       "    var targ;\n",
       "    if (!e)\n",
       "        e = window.event;\n",
       "    if (e.target)\n",
       "        targ = e.target;\n",
       "    else if (e.srcElement)\n",
       "        targ = e.srcElement;\n",
       "    if (targ.nodeType == 3) // defeat Safari bug\n",
       "        targ = targ.parentNode;\n",
       "\n",
       "    // jQuery normalizes the pageX and pageY\n",
       "    // pageX,Y are the mouse positions relative to the document\n",
       "    // offset() returns the position of the element relative to the document\n",
       "    var x = e.pageX - $(targ).offset().left;\n",
       "    var y = e.pageY - $(targ).offset().top;\n",
       "\n",
       "    return {\"x\": x, \"y\": y};\n",
       "};\n",
       "\n",
       "/*\n",
       " * return a copy of an object with only non-object keys\n",
       " * we need this to avoid circular references\n",
       " * http://stackoverflow.com/a/24161582/3208463\n",
       " */\n",
       "function simpleKeys (original) {\n",
       "  return Object.keys(original).reduce(function (obj, key) {\n",
       "    if (typeof original[key] !== 'object')\n",
       "        obj[key] = original[key]\n",
       "    return obj;\n",
       "  }, {});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.mouse_event = function(event, name) {\n",
       "    var canvas_pos = mpl.findpos(event)\n",
       "\n",
       "    if (name === 'button_press')\n",
       "    {\n",
       "        this.canvas.focus();\n",
       "        this.canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    var x = canvas_pos.x * mpl.ratio;\n",
       "    var y = canvas_pos.y * mpl.ratio;\n",
       "\n",
       "    this.send_message(name, {x: x, y: y, button: event.button,\n",
       "                             step: event.step,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "\n",
       "    /* This prevents the web browser from automatically changing to\n",
       "     * the text insertion cursor when the button is pressed.  We want\n",
       "     * to control all of the cursor setting manually through the\n",
       "     * 'cursor' event from matplotlib */\n",
       "    event.preventDefault();\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    // Handle any extra behaviour associated with a key event\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.key_event = function(event, name) {\n",
       "\n",
       "    // Prevent repeat events\n",
       "    if (name == 'key_press')\n",
       "    {\n",
       "        if (event.which === this._key)\n",
       "            return;\n",
       "        else\n",
       "            this._key = event.which;\n",
       "    }\n",
       "    if (name == 'key_release')\n",
       "        this._key = null;\n",
       "\n",
       "    var value = '';\n",
       "    if (event.ctrlKey && event.which != 17)\n",
       "        value += \"ctrl+\";\n",
       "    if (event.altKey && event.which != 18)\n",
       "        value += \"alt+\";\n",
       "    if (event.shiftKey && event.which != 16)\n",
       "        value += \"shift+\";\n",
       "\n",
       "    value += 'k';\n",
       "    value += event.which.toString();\n",
       "\n",
       "    this._key_event_extra(event, name);\n",
       "\n",
       "    this.send_message(name, {key: value,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
       "    if (name == 'download') {\n",
       "        this.handle_save(this, null);\n",
       "    } else {\n",
       "        this.send_message(\"toolbar_button\", {name: name});\n",
       "    }\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
       "    this.message.textContent = tooltip;\n",
       "};\n",
       "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
       "\n",
       "mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
       "\n",
       "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
       "    // Create a \"websocket\"-like object which calls the given IPython comm\n",
       "    // object with the appropriate methods. Currently this is a non binary\n",
       "    // socket, so there is still some room for performance tuning.\n",
       "    var ws = {};\n",
       "\n",
       "    ws.close = function() {\n",
       "        comm.close()\n",
       "    };\n",
       "    ws.send = function(m) {\n",
       "        //console.log('sending', m);\n",
       "        comm.send(m);\n",
       "    };\n",
       "    // Register the callback with on_msg.\n",
       "    comm.on_msg(function(msg) {\n",
       "        //console.log('receiving', msg['content']['data'], msg);\n",
       "        // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
       "        ws.onmessage(msg['content']['data'])\n",
       "    });\n",
       "    return ws;\n",
       "}\n",
       "\n",
       "mpl.mpl_figure_comm = function(comm, msg) {\n",
       "    // This is the function which gets called when the mpl process\n",
       "    // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
       "\n",
       "    var id = msg.content.data.id;\n",
       "    // Get hold of the div created by the display call when the Comm\n",
       "    // socket was opened in Python.\n",
       "    var element = $(\"#\" + id);\n",
       "    var ws_proxy = comm_websocket_adapter(comm)\n",
       "\n",
       "    function ondownload(figure, format) {\n",
       "        window.open(figure.imageObj.src);\n",
       "    }\n",
       "\n",
       "    var fig = new mpl.figure(id, ws_proxy,\n",
       "                           ondownload,\n",
       "                           element.get(0));\n",
       "\n",
       "    // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
       "    // web socket which is closed, not our websocket->open comm proxy.\n",
       "    ws_proxy.onopen();\n",
       "\n",
       "    fig.parent_element = element.get(0);\n",
       "    fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n",
       "    if (!fig.cell_info) {\n",
       "        console.error(\"Failed to find cell for figure\", id, fig);\n",
       "        return;\n",
       "    }\n",
       "\n",
       "    var output_index = fig.cell_info[2]\n",
       "    var cell = fig.cell_info[0];\n",
       "\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.handle_close = function(fig, msg) {\n",
       "    var width = fig.canvas.width/mpl.ratio\n",
       "    fig.root.unbind('remove')\n",
       "\n",
       "    // Update the output cell to use the data from the current canvas.\n",
       "    fig.push_to_output();\n",
       "    var dataURL = fig.canvas.toDataURL();\n",
       "    // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
       "    // the notebook keyboard shortcuts fail.\n",
       "    IPython.keyboard_manager.enable()\n",
       "    $(fig.parent_element).html('<img src=\"' + dataURL + '\" width=\"' + width + '\">');\n",
       "    fig.close_ws(fig, msg);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.close_ws = function(fig, msg){\n",
       "    fig.send_message('closing', msg);\n",
       "    // fig.ws.close()\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
       "    // Turn the data on the canvas into data in the output cell.\n",
       "    var width = this.canvas.width/mpl.ratio\n",
       "    var dataURL = this.canvas.toDataURL();\n",
       "    this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\" width=\"' + width + '\">';\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Tell IPython that the notebook contents must change.\n",
       "    IPython.notebook.set_dirty(true);\n",
       "    this.send_message(\"ack\", {});\n",
       "    var fig = this;\n",
       "    // Wait a second, then push the new image to the DOM so\n",
       "    // that it is saved nicely (might be nice to debounce this).\n",
       "    setTimeout(function () { fig.push_to_output() }, 1000);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items){\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) { continue; };\n",
       "\n",
       "        var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    // Add the status bar.\n",
       "    var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "\n",
       "    // Add the close button to the window.\n",
       "    var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n",
       "    var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n",
       "    button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
       "    button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
       "    buttongrp.append(button);\n",
       "    var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
       "    titlebar.prepend(buttongrp);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(el){\n",
       "    var fig = this\n",
       "    el.on(\"remove\", function(){\n",
       "\tfig.close_ws(fig, {});\n",
       "    });\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(el){\n",
       "    // this is important to make the div 'focusable\n",
       "    el.attr('tabindex', 0)\n",
       "    // reach out to IPython and tell the keyboard manager to turn it's self\n",
       "    // off when our div gets focus\n",
       "\n",
       "    // location in version 3\n",
       "    if (IPython.notebook.keyboard_manager) {\n",
       "        IPython.notebook.keyboard_manager.register_events(el);\n",
       "    }\n",
       "    else {\n",
       "        // location in version 2\n",
       "        IPython.keyboard_manager.register_events(el);\n",
       "    }\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    var manager = IPython.notebook.keyboard_manager;\n",
       "    if (!manager)\n",
       "        manager = IPython.keyboard_manager;\n",
       "\n",
       "    // Check for shift+enter\n",
       "    if (event.shiftKey && event.which == 13) {\n",
       "        this.canvas_div.blur();\n",
       "        // select the cell after this one\n",
       "        var index = IPython.notebook.find_cell_index(this.cell_info[0]);\n",
       "        IPython.notebook.select(index + 1);\n",
       "    }\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    fig.ondownload(fig, null);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.find_output_cell = function(html_output) {\n",
       "    // Return the cell and output element which can be found *uniquely* in the notebook.\n",
       "    // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
       "    // IPython event is triggered only after the cells have been serialised, which for\n",
       "    // our purposes (turning an active figure into a static one), is too late.\n",
       "    var cells = IPython.notebook.get_cells();\n",
       "    var ncells = cells.length;\n",
       "    for (var i=0; i<ncells; i++) {\n",
       "        var cell = cells[i];\n",
       "        if (cell.cell_type === 'code'){\n",
       "            for (var j=0; j<cell.output_area.outputs.length; j++) {\n",
       "                var data = cell.output_area.outputs[j];\n",
       "                if (data.data) {\n",
       "                    // IPython >= 3 moved mimebundle to data attribute of output\n",
       "                    data = data.data;\n",
       "                }\n",
       "                if (data['text/html'] == html_output) {\n",
       "                    return [cell, data, j];\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "}\n",
       "\n",
       "// Register the function which deals with the matplotlib target/channel.\n",
       "// The kernel may be null if the page has been refreshed.\n",
       "if (IPython.notebook.kernel != null) {\n",
       "    IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
       "}\n"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<img src=\"\" width=\"639.230792677615\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from __future__ import (absolute_import, division, print_function,\n",
    "                        unicode_literals)\n",
    "from pkg_resources import resource_filename\n",
    "import datetime\n",
    "import os.path\n",
    "import sys\n",
    "import backtrader as bt\n",
    "import backtrader.feeds as btfeed\n",
    "\n",
    "INIT_CASH = 100000\n",
    "BAND_PERIOD = 30\n",
    "COMMISSION_PER_TRANSACTION = 0.006\n",
    "DATA_FILE = resource_filename(__name__,'../data/JFC_2010-01-01_2019-01-01_OHLCV.csv')\n",
    "\n",
    "class MinMaxSupportResistance(bt.Strategy):\n",
    "    def log(self, txt, dt=None):\n",
    "        dt = dt or self.datas[0].datetime.date(0)\n",
    "        print('%s, %s' % (dt.isoformat(), txt))\n",
    "\n",
    "    def __init__(self):\n",
    "        self.dataclose = self.datas[0].close\n",
    "        self.order = None\n",
    "        self.buyprice = None\n",
    "        self.buycomm = None\n",
    "\n",
    "        self.minn = bt.indicators.MinN(self.datas[0], period=BAND_PERIOD)\n",
    "        self.maxn = bt.indicators.MaxN(self.datas[0], period=BAND_PERIOD)\n",
    "\n",
    "    def notify_order(self, order):\n",
    "        if order.status in [order.Submitted, order.Accepted]:\n",
    "            return\n",
    "\n",
    "        if order.status in [order.Completed]:\n",
    "            if order.isbuy():\n",
    "                self.log(\n",
    "                    'BUY EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f' %\n",
    "                    (order.executed.price,\n",
    "                     order.executed.value,\n",
    "                     order.executed.comm))\n",
    "\n",
    "                self.buyprice = order.executed.price\n",
    "                self.buycomm = order.executed.comm\n",
    "            else:  # Sell\n",
    "                self.log('SELL EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f' %\n",
    "                         (order.executed.price,\n",
    "                          order.executed.value,\n",
    "                          order.executed.comm))\n",
    "\n",
    "            self.bar_executed = len(self)\n",
    "\n",
    "        elif order.status in [order.Canceled, order.Margin, order.Rejected]:\n",
    "            self.log('Order Canceled/Margin/Rejected')\n",
    "\n",
    "        # Write down: no pending order\n",
    "        self.order = None\n",
    "        \n",
    "    def notify_cashvalue(self, cash, value):\n",
    "        # Update cash and value every period\n",
    "        self.log('Cash %s Value %s' % (cash, value))\n",
    "        self.cash = cash\n",
    "        self.value = value\n",
    "\n",
    "    def notify_trade(self, trade):\n",
    "        if not trade.isclosed:\n",
    "            return\n",
    "\n",
    "        self.log('OPERATION PROFIT, GROSS %.2f, NET %.2f' %\n",
    "                 (trade.pnl, trade.pnlcomm))\n",
    "\n",
    "    def next(self):\n",
    "        self.log('Close, %.2f' % self.dataclose[0])\n",
    "        print('Max price:', self.maxn[0])\n",
    "        print('Min price:', self.minn[0])\n",
    "        if self.order:\n",
    "            return\n",
    "\n",
    "        # Only buy if there is enough cash for at least one stock\n",
    "        if self.cash >= self.dataclose[0]:\n",
    "            # Sell if the current closing is the lowest in the last N days\n",
    "            if (self.dataclose[0] == self.maxn):\n",
    "                self.log('BUY CREATE, %.2f' % self.dataclose[0])\n",
    "                # Take a 10% long position every time it's a buy signal (or whatever is afforder by the current cash position)\n",
    "                # \"size\" refers to the number of stocks to purchase\n",
    "                self.order = self.buy(size=int(min((INIT_CASH / self.dataclose[0]) * 0.1, self.cash / self.dataclose[0])))\n",
    "\n",
    "        # Only sell if you hold least one unit of the stock (and sell only that stock, so no short selling)\n",
    "        if (self.value - self.cash) > 0:\n",
    "            # Buy if the current closing is the highest in the last N days\n",
    "            if (self.dataclose[0] == self.minn):\n",
    "                self.log('SELL CREATE, %.2f' % self.dataclose[0])\n",
    "                # Sell a 5% sell position (or whatever is afforded by the current stock holding)\n",
    "                # \"size\" refers to the number of stocks to purchase\n",
    "                self.order = self.sell(size=int(min((INIT_CASH / self.dataclose[0]) * 0.05, (self.value - self.cash) / self.dataclose[0])))\n",
    "\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    cerebro = bt.Cerebro()\n",
    "    cerebro.addstrategy(MinMaxSupportResistance)\n",
    "    cerebro.broker.setcommission(commission=COMMISSION_PER_TRANSACTION)\n",
    "\n",
    "    data = btfeed.GenericCSVData(\n",
    "        dataname=DATA_FILE,\n",
    "\n",
    "        fromdate=datetime.datetime(2017, 1, 1),\n",
    "        todate=datetime.datetime(2019, 1, 1),\n",
    "\n",
    "        nullvalue=0.0,\n",
    "\n",
    "        dtformat=('%Y-%m-%d'),\n",
    "\n",
    "        datetime=0,\n",
    "        open=1,\n",
    "        high=2,\n",
    "        low=3,\n",
    "        close=4,\n",
    "        volume=5,\n",
    "        openinterest=-1\n",
    "    )\n",
    "    cerebro.adddata(data)\n",
    "    cerebro.broker.setcash(INIT_CASH)\n",
    "    print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue())\n",
    "    cerebro.run()\n",
    "    print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())\n",
    "    cerebro.plot(figsize=(30, 15))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
